MCPcopy Create free account
hub / github.com/google/agents-cli / depthOf

Function depthOf

docs/src/javascripts/lifecycle.js:865–872  ·  view source on GitHub ↗
(id, memo)

Source from the content-addressed store, hash-verified

863 const byId = {};
864 TRACE_SPANS.forEach((s) => (byId[s.id] = s));
865 function depthOf(id, memo) {
866 if (!memo) memo = {};
867 if (memo[id] != null) return memo[id];
868 const s = byId[id];
869 if (!s || s.parent == null) memo[id] = 0;
870 else memo[id] = depthOf(s.parent, memo) + 1;
871 return memo[id];
872 }
873 const memo = {};
874 const depths = {};
875 TRACE_SPANS.forEach((s) => (depths[s.id] = depthOf(s.id, memo)));

Callers 1

initTraceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected