(list: TraceSpan[])
| 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 | } |
no test coverage detected