MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / traverse

Method traverse

tools/mcdevicetree.js:1483–1489  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

1481 const selected = [];
1482
1483 function traverse(node) {
1484 if (callback(node))
1485 selected.push(node);
1486
1487 for (const child of Object.values(node.children))
1488 traverse(child);
1489 }
1490
1491 for (const node of Object.values(tree.nodes))
1492 traverse(node);

Callers

nothing calls this directly

Calls 3

valuesMethod · 0.80
callbackFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected