(roots: readonly HyperFramesElement[])
| 241 | |
| 242 | /** Flat walk of the element tree — returns every element in document order */ |
| 243 | export function flatElements(roots: readonly HyperFramesElement[]): HyperFramesElement[] { |
| 244 | const result: HyperFramesElement[] = []; |
| 245 | function walk(el: HyperFramesElement) { |
| 246 | result.push(el); |
| 247 | for (const child of el.children) walk(child); |
| 248 | } |
| 249 | for (const root of roots) walk(root); |
| 250 | return result; |
| 251 | } |
no test coverage detected