MCPcopy Create free account
hub / github.com/FIND-Lab/AgentWard / getConfigAtPath

Function getConfigAtPath

core/commands.ts:26–34  ·  view source on GitHub ↗

Get a value from a nested object by dot-path.

(obj: Record<string, unknown>, path: string)

Source from the content-addressed store, hash-verified

24
25/** Get a value from a nested object by dot-path. */
26function getConfigAtPath(obj: Record<string, unknown>, path: string): unknown {
27 const parts = path.split(".");
28 let current: unknown = obj;
29 for (const part of parts) {
30 if (current === null || typeof current !== "object") return undefined;
31 current = (current as Record<string, unknown>)[part];
32 }
33 return current;
34}
35
36/** Set a value in a nested object by dot-path (mutates). */
37function setConfigAtPath(obj: Record<string, unknown>, path: string, value: unknown): boolean {

Callers 2

formatConfigTreeFunction · 0.85
handleAgentWardCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected