MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / filter

Method filter

tools/mcdevicetree.js:1480–1495  ·  view source on GitHub ↗
(tree, callback)

Source from the content-addressed store, hash-verified

1478 }
1479
1480 static filter(tree, callback) {
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);
1493
1494 return selected;
1495 }
1496}

Callers 15

transformFlowsMethod · 0.45
prepareNodeMethod · 0.45
runMethod · 0.45
runMethod · 0.45
getNodesFunction · 0.45
mainFunction · 0.45
initFunction · 0.45
_syncCompleterMethod · 0.45
resolveFilePathMethod · 0.45
resolveDotPathMethod · 0.45
searchPrivateFieldMethod · 0.45
cmdInfoModulesMethod · 0.45

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected