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

Function canon

__tests__/kernel-node-id-parity.test.ts:30–36  ·  view source on GitHub ↗
(result: ExtractionResult)

Source from the content-addressed store, hash-verified

28];
29
30function canon(result: ExtractionResult) {
31 return {
32 nodes: result.nodes.map(({ updatedAt: _u, ...n }) => JSON.stringify(n, Object.keys(n).sort())).sort(),
33 edges: result.edges.map((e) => JSON.stringify(e, Object.keys(e).sort())).sort(),
34 refs: result.unresolvedReferences.map((r) => JSON.stringify(r, Object.keys(r).sort())).sort(),
35 };
36}
37
38const kernelBuilt = fs.existsSync(path.join(__dirname, '..', 'codegraph-kernel', 'prebuilds',
39 `${process.platform}-${process.arch}`, 'codegraph-kernel.node'));

Callers 1

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected