MCPcopy Create free account
hub / github.com/Noumena-Network/code / getNested

Function getNested

src/commands/agents-platform/agents-platform.tsx:53–69  ·  view source on GitHub ↗
(value: unknown, path: PathSegment[])

Source from the content-addressed store, hash-verified

51}
52
53function getNested(value: unknown, path: PathSegment[]): unknown {
54 let current: unknown = value
55 for (const segment of path) {
56 if (typeof segment === 'number') {
57 if (!Array.isArray(current) || segment >= current.length) {
58 return undefined
59 }
60 current = current[segment]
61 continue
62 }
63 if (!isRecord(current)) {
64 return undefined
65 }
66 current = current[segment]
67 }
68 return current
69}
70
71function getFirstString(value: unknown, paths: PathSegment[][]): string | null {
72 for (const path of paths) {

Callers 5

getFirstStringFunction · 0.85
getFirstBooleanFunction · 0.85
getRecordArrayFunction · 0.85
extractRoutineRecordsFunction · 0.85
extractRepoUrlsFunction · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected