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

Function canon

__tests__/kernel-php-parity.test.ts:55–65  ·  view source on GitHub ↗
(result: ExtractionResult)

Source from the content-addressed store, hash-verified

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

Callers 1

assertParityFunction · 0.70

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected