MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / visit

Function visit

scripts/integration/cli.mjs:1709–1725  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

1707function compactQueryNodes(snapshot) {
1708 const nodes = [];
1709 const visit = (node) => {
1710 if (!node || typeof node !== "object") {
1711 return;
1712 }
1713 if (
1714 "role" in node ||
1715 "id" in node ||
1716 "label" in node ||
1717 "value" in node ||
1718 "frame" in node
1719 ) {
1720 nodes.push(node);
1721 }
1722 for (const child of Array.isArray(node.children) ? node.children : []) {
1723 visit(child);
1724 }
1725 };
1726 for (const match of Array.isArray(snapshot?.matches)
1727 ? snapshot.matches
1728 : []) {

Callers 2

compactQueryNodesFunction · 0.70
countAccessibilityNodesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected