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

Function canon

__tests__/kernel-php-parity.test.ts:53–63  ·  view source on GitHub ↗
(result: ExtractionResult)

Source from the content-addressed store, hash-verified

51const FIXTURE_DIR = path.join(__dirname, 'fixtures', 'kernel-parity');
52
53function canon(result: ExtractionResult): { nodes: string[]; edges: string[]; refs: string[] } {
54 return {
55 nodes: result.nodes
56 .map(({ updatedAt: _u, ...n }) => JSON.stringify(n, Object.keys(n).sort()))
57 .sort(),
58 edges: result.edges.map((e) => JSON.stringify(e, Object.keys(e).sort())).sort(),
59 refs: result.unresolvedReferences
60 .map((r) => JSON.stringify(r, Object.keys(r).sort()))
61 .sort(),
62 };
63}
64
65const ENV_KEYS = ['CODEGRAPH_KERNEL', 'CODEGRAPH_KERNEL_LANGS'] as const;
66let savedEnv: Record<string, string | undefined>;

Callers 1

assertParityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected