MCPcopy Index your code
hub / github.com/simstudioai/sim / walk

Function walk

apps/sim/lib/logs/log-views.ts:94–105  ·  view source on GitHub ↗
(list: TraceSpan[])

Source from the content-addressed store, hash-verified

92 if (!selector || (!selector.blockId && !selector.blockName)) return spans
93 const out: TraceSpan[] = []
94 const walk = (list: TraceSpan[]): void => {
95 for (const s of list) {
96 const matches =
97 (selector.blockId !== undefined && s.blockId === selector.blockId) ||
98 (selector.blockName !== undefined && s.name === selector.blockName)
99 if (matches) {
100 out.push(s)
101 } else if (s.children && s.children.length > 0) {
102 walk(s.children)
103 }
104 }
105 }
106 walk(spans)
107 return out
108}

Callers 2

selectSpansFunction · 0.70
grepSpansFunction · 0.70

Calls 4

doneFunction · 0.85
recordIfMatchFunction · 0.85
grepFieldFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected