( nodes: SnapshotState['nodes'], selector: Selector, platform: Platform | PublicPlatform, requireRect: boolean, )
| 128 | } |
| 129 | |
| 130 | function 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 | |
| 145 | function compareDisambiguationCandidates(a: SnapshotNode, b: SnapshotNode): number { |
| 146 | const depthA = a.depth ?? 0; |
no test coverage detected