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

Function graftPath

graph-ui/src/app/tree-model.ts:911–927  ·  view source on GitHub ↗
(levels: Map<string, TreeLevel>, path: string, kind: 'file' | 'dir')

Source from the content-addressed store, hash-verified

909}
910
911function graftPath(levels: Map<string, TreeLevel>, path: string, kind: 'file' | 'dir'): void {
912 const parent = parentPath(path);
913 if (parent.length > 0) {
914 graftPath(levels, parent, 'dir');
915 }
916 const level = ensureLevel(levels, parent);
917 if (level.children.some((child) => child.path === path)) {
918 return;
919 }
920 level.children.push({
921 name: path.slice(path.lastIndexOf('/') + 1),
922 path,
923 kind,
924 symbols: 0,
925 files: 0,
926 });
927}
928
929/**
930 * Die Vereinigung: die Ebenen aus dem Graphen, ergaenzt um jeden Pfad, den nur

Callers 1

mergeCoverageIntoLevelsFunction · 0.85

Calls 3

ensureLevelFunction · 0.85
parentPathFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected