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

Function canon

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

Source from the content-addressed store, hash-verified

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

Callers 1

assertParityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected