MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / flatElements

Function flatElements

packages/sdk/src/document.ts:243–251  ·  view source on GitHub ↗
(roots: readonly HyperFramesElement[])

Source from the content-addressed store, hash-verified

241
242/** Flat walk of the element tree — returns every element in document order */
243export 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}

Callers 2

getElementsMethod · 0.85

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected