MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / getValueForKey

Function getValueForKey

src/utils/nskeyedarchiver-parser.ts:88–98  ·  view source on GitHub ↗

* Gets the value for a key in an NS.keys/NS.objects dictionary

(objects: unknown[], dict: ArchivedDict, keyIndex: number)

Source from the content-addressed store, hash-verified

86 * Gets the value for a key in an NS.keys/NS.objects dictionary
87 */
88function getValueForKey(objects: unknown[], dict: ArchivedDict, keyIndex: number): unknown {
89 const keys = dict['NS.keys'];
90 const values = dict['NS.objects'];
91
92 if (!Array.isArray(keys) || !Array.isArray(values)) return undefined;
93
94 const keyPosition = keys.findIndex((k) => isUID(k) && k.UID === keyIndex);
95 if (keyPosition === -1 || keyPosition >= values.length) return undefined;
96
97 return resolveUID(objects, values[keyPosition]);
98}
99
100/**
101 * Main entry point: parses xcuserstate file and extracts Xcode state

Callers 2

parseXcuserstateFunction · 0.85
parseXcuserstateBufferFunction · 0.85

Calls 2

isUIDFunction · 0.85
resolveUIDFunction · 0.85

Tested by

no test coverage detected