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

Function walk

graph-ui/src/app/tree-model.ts:289–307  ·  view source on GitHub ↗
(path: string, depth: number, seen: Set<string>)

Source from the content-addressed store, hash-verified

287): TreeRow[] {
288 const rows: TreeRow[] = [];
289 const walk = (path: string, depth: number, seen: Set<string>): void => {
290 const level = levels.get(path);
291 if (level === undefined || seen.has(path)) {
292 return;
293 }
294 seen.add(path);
295 for (const child of level.children) {
296 const isExpanded = child.kind === 'dir' && expanded.has(child.path);
297 rows.push({
298 ...child,
299 depth,
300 expanded: isExpanded,
301 loaded: child.kind === 'dir' ? levels.has(child.path) : true,
302 });
303 if (isExpanded) {
304 walk(child.path, depth + 1, seen);
305 }
306 }
307 };
308 walk(rootPath, 0, new Set());
309 return rows;
310}

Callers 1

flattenTreeFunction · 0.70

Calls 2

getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected