MCPcopy Create free account
hub / github.com/cloudflare/agents / summarizeNode

Function summarizeNode

packages/shell/src/extras.ts:356–373  ·  view source on GitHub ↗
(
  node: StateTreeNode,
  depth: number,
  summary: StateTreeSummary
)

Source from the content-addressed store, hash-verified

354}
355
356function summarizeNode(
357 node: StateTreeNode,
358 depth: number,
359 summary: StateTreeSummary
360): void {
361 summary.maxDepth = Math.max(summary.maxDepth, depth);
362 if (node.type === "file") {
363 summary.files++;
364 summary.totalBytes += node.size;
365 } else if (node.type === "directory") {
366 summary.directories++;
367 } else {
368 summary.symlinks++;
369 }
370 for (const child of node.children ?? []) {
371 summarizeNode(child, depth + 1, summary);
372 }
373}
374
375async function visitFind(
376 path: string,

Callers 1

summarizeTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected