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

Function buildNestedObject

src/tools/ConfigTool/ConfigTool.ts:457–469  ·  view source on GitHub ↗
(
  path: string[],
  value: unknown,
)

Source from the content-addressed store, hash-verified

455}
456
457function buildNestedObject(
458 path: string[],
459 value: unknown,
460): Record<string, unknown> {
461 if (path.length === 0) {
462 return {}
463 }
464 const key = path[0]!
465 if (path.length === 1) {
466 return { [key]: value }
467 }
468 return { [key]: buildNestedObject(path.slice(1), value) }
469}

Callers 1

callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected