MCPcopy
hub / github.com/colbymchenry/codegraph / pragmaValue

Function pragmaValue

__tests__/concurrent-locking.test.ts:21–25  ·  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

19
20/** Normalize a PRAGMA read across return shapes (array | object | scalar). */
21function pragmaValue(raw: unknown, key: string): unknown {
22 const row = Array.isArray(raw) ? raw[0] : raw;
23 if (row !== null && typeof row === 'object') return (row as Record<string, unknown>)[key];
24 return row;
25}
26
27describe('issue #238 — connection PRAGMAs (#1)', () => {
28 let dir: string;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected