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

Function pragmaValue

__tests__/foundation.test.ts:30–34  ·  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

28
29/** Normalize a PRAGMA read across return shapes (array | object | scalar). */
30function pragmaValue(raw: unknown, key: string): unknown {
31 const row = Array.isArray(raw) ? raw[0] : raw;
32 if (row !== null && typeof row === 'object') return (row as Record<string, unknown>)[key];
33 return row;
34}
35
36describe('CodeGraph Foundation', () => {
37 let tempDir: string;

Callers 1

foundation.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected