MCPcopy Index your code
hub / github.com/callstack/agent-device / countSelectorMatchesOnly

Function countSelectorMatchesOnly

src/daemon/selectors-resolve.ts:130–143  ·  view source on GitHub ↗
(
  nodes: SnapshotState['nodes'],
  selector: Selector,
  platform: Platform | PublicPlatform,
  requireRect: boolean,
)

Source from the content-addressed store, hash-verified

128}
129
130function countSelectorMatchesOnly(
131 nodes: SnapshotState['nodes'],
132 selector: Selector,
133 platform: Platform | PublicPlatform,
134 requireRect: boolean,
135): number {
136 let count = 0;
137 for (const node of nodes) {
138 if (requireRect && !node.rect) continue;
139 if (!matchesSelector(node, selector, platform)) continue;
140 count += 1;
141 }
142 return count;
143}
144
145function compareDisambiguationCandidates(a: SnapshotNode, b: SnapshotNode): number {
146 const depthA = a.depth ?? 0;

Callers 1

findSelectorChainMatchFunction · 0.85

Calls 1

matchesSelectorFunction · 0.90

Tested by

no test coverage detected