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

Function canon

__tests__/kernel-kotlin-parity.test.ts:48–58  ·  view source on GitHub ↗
(result: ExtractionResult)

Source from the content-addressed store, hash-verified

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

Callers 1

assertParityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected