(nodes)
| 190 | |
| 191 | // Walk tree, emit one summary string per meaningful interactive node. |
| 192 | function collectSummaries(nodes) { |
| 193 | return nodes.flatMap(node => { |
| 194 | const fromChildren = collectSummaries(node.children) |
| 195 | if (!INTERACTIVE_ROLES.has(node.role)) return fromChildren |
| 196 | const summary = formatNode(node) |
| 197 | if (summary === node.role) return fromChildren // skip empty unnamed interactive nodes |
| 198 | return [summary, ...fromChildren] |
| 199 | }) |
| 200 | } |
| 201 | |
| 202 | function countBy(items) { |
| 203 | return items.reduce((map, item) => { |
no test coverage detected