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

Function canon

__tests__/kernel-lua-parity.test.ts:50–60  ·  view source on GitHub ↗
(result: ExtractionResult)

Source from the content-addressed store, hash-verified

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

Callers 1

assertParityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected