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

Function hierarchyPath

graph-ui/src/architecture/semantic-graph.ts:206–207  ·  view source on GitHub ↗
(path: string | undefined)

Source from the content-addressed store, hash-verified

204 z: number;
205}
206const hierarchyPath = (path: string | undefined) => !path || path === '{}' ? undefined
207 : path.replaceAll('\\', '/').replace(/^\.\//, '').replace(/\/+/g, '/').replace(/\/$/, '');
208const parentPath = (path: string) => path.includes('/') ? path.slice(0, path.lastIndexOf('/')) : '';
209const hierarchyNodeOrder = (a: SemanticNode, b: SemanticNode) => compare(hierarchyPath(a.filePath) ?? a.areaPath ?? '', hierarchyPath(b.filePath) ?? b.areaPath ?? '')
210 || (a.line ?? 0) - (b.line ?? 0) || compare(a.id, b.id);

Callers 2

hierarchyNodeOrderFunction · 0.85
layoutFolderHierarchyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected