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

Function snapshot_contains_element

packages/server/src/main/batch.rs:725–735  ·  view source on GitHub ↗
(snapshot: &Value, selector: &ElementSelector)

Source from the content-addressed store, hash-verified

723}
724
725fn snapshot_contains_element(snapshot: &Value, selector: &ElementSelector) -> bool {
726 snapshot
727 .get("roots")
728 .and_then(Value::as_array)
729 .map(|roots| {
730 roots
731 .iter()
732 .any(|root| node_contains_matching_element(root, selector))
733 })
734 .unwrap_or(false)
735}
736
737fn node_contains_matching_element(node: &Value, selector: &ElementSelector) -> bool {
738 element_matches(node, selector)

Callers 1

wait_for_batch_selectorFunction · 0.85

Calls 2

getMethod · 0.65

Tested by

no test coverage detected