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

Function canon

__tests__/kernel-ccpp-parity.test.ts:44–54  ·  view source on GitHub ↗
(result: ExtractionResult)

Source from the content-addressed store, hash-verified

42const FIXTURE_DIR = path.join(__dirname, 'fixtures', 'kernel-parity');
43
44function canon(result: ExtractionResult): { nodes: string[]; edges: string[]; refs: string[] } {
45 return {
46 nodes: result.nodes
47 .map(({ updatedAt: _u, ...n }) => JSON.stringify(n, Object.keys(n).sort()))
48 .sort(),
49 edges: result.edges.map((e) => JSON.stringify(e, Object.keys(e).sort())).sort(),
50 refs: result.unresolvedReferences
51 .map((r) => JSON.stringify(r, Object.keys(r).sort()))
52 .sort(),
53 };
54}
55
56const ENV_KEYS = ['CODEGRAPH_KERNEL', 'CODEGRAPH_KERNEL_LANGS'] as const;
57let savedEnv: Record<string, string | undefined>;

Callers 1

assertParityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected