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

Function canon

__tests__/kernel-rustlang-parity.test.ts:41–51  ·  view source on GitHub ↗
(result: ExtractionResult)

Source from the content-addressed store, hash-verified

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

Callers 1

assertParityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected