MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / compareNodes

Function compareNodes

graph-ui/src/galaxy/reader-hierarchy.ts:17–19  ·  view source on GitHub ↗
(a: GraphNode, b: GraphNode)

Source from the content-addressed store, hash-verified

15
16const compareText = (a: string, b: string) => a < b ? -1 : a > b ? 1 : 0;
17const compareNodes = (a: GraphNode, b: GraphNode) => compareText(a.file_path ?? '', b.file_path ?? '')
18 || (a.start_line ?? 0) - (b.start_line ?? 0)
19 || compareText(a.qualified_name ?? a.name, b.qualified_name ?? b.name) || a.id - b.id;
20const definitionEdge = (type: string) => /^(DEFINES(?:_|$)|CONTAINS$|DECLARES$)/.test(type);
21
22/** File definitions and their direct relationships, using only the loaded graph. */

Callers

nothing calls this directly

Calls 1

compareTextFunction · 0.70

Tested by

no test coverage detected