Skip to content

Commit 1219626

Browse files
chrfalchclaude
andcommitted
fix(ios-prebuild): resolve Flow errors in framework-resources.js
mixed is now a deprecated utility type (use unknown), and the NSPrivacyAccessedAPITypeReasons refinement was invalidated by the intervening Map.get() call — hoist it into a local first. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5d44159 commit 1219626

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/react-native/scripts/ios-prebuild/framework-resources.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ type PrivacyManifest = {
5757

5858
// Recursively sorts object keys so structurally-equal values serialize
5959
// identically regardless of source key order (arrays keep their order).
60-
function canonicalize(value /*: mixed */) /*: mixed */ {
60+
function canonicalize(value /*: unknown */) /*: unknown */ {
6161
if (Array.isArray(value)) {
6262
return value.map(canonicalize);
6363
}
6464
if (value != null && typeof value === 'object') {
65-
const out /*: {[string]: mixed} */ = {};
65+
const out /*: {[string]: unknown} */ = {};
6666
for (const k of Object.keys(value).sort()) {
6767
out[k] = canonicalize(value[k]);
6868
}
@@ -103,11 +103,12 @@ function mergePrivacyManifests(
103103
reasonsByType.set(category, []);
104104
typeOrder.push(category);
105105
}
106-
if (entry.NSPrivacyAccessedAPITypeReasons != null) {
106+
const entryReasons = entry.NSPrivacyAccessedAPITypeReasons;
107+
if (entryReasons != null) {
107108
typeHadReasonsKey.add(category);
108109
const reasons = reasonsByType.get(category);
109110
if (reasons != null) {
110-
for (const reason of entry.NSPrivacyAccessedAPITypeReasons) {
111+
for (const reason of entryReasons) {
111112
if (!reasons.includes(reason)) {
112113
reasons.push(reason);
113114
}

0 commit comments

Comments
 (0)