(nodes, depth = 0)
| 172 | } |
| 173 | |
| 174 | function renderTree(nodes, depth = 0) { |
| 175 | const items = groupByConsecutiveRole(nodes).flatMap(group => collapseGroup(group, depth)) |
| 176 | return items |
| 177 | .map(item => { |
| 178 | if (typeof item === 'string') return item |
| 179 | const indent = ' '.repeat(depth) |
| 180 | const head = `${indent}- ${formatNode(item)}` |
| 181 | if (item.children.length === 0) return head |
| 182 | return `${head}:\n${renderTree(item.children, depth + 1)}` |
| 183 | }) |
| 184 | .join('\n') |
| 185 | } |
| 186 | |
| 187 | // ───────────────────────────────────────────────────────────────── |
| 188 | // STEP 4 · Diff: collect interactive summaries → bag diff → text |
no test coverage detected