MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / pragmaValue

Function pragmaValue

__tests__/index-command.test.ts:28–32  ·  view source on GitHub ↗

Normalize a PRAGMA read across return shapes (array | object | scalar).

(raw: unknown, key: string)

Source from the content-addressed store, hash-verified

26
27/** Normalize a PRAGMA read across return shapes (array | object | scalar). */
28function pragmaValue(raw: unknown, key: string): unknown {
29 const row = Array.isArray(raw) ? raw[0] : raw;
30 if (row !== null && typeof row === 'object') return (row as Record<string, unknown>)[key];
31 return row;
32}
33
34function runCodegraph(args: string[], cwd: string): string {
35 return execFileSync(process.execPath, [BIN, ...args], {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected