(node: &mut Value, depth: usize, max_depth: usize)
| 4883 | } |
| 4884 | |
| 4885 | fn trim_node_depth(node: &mut Value, depth: usize, max_depth: usize) { |
| 4886 | let Some(object) = node.as_object_mut() else { |
| 4887 | return; |
| 4888 | }; |
| 4889 | if depth >= max_depth { |
| 4890 | object.insert("children".to_owned(), Value::Array(Vec::new())); |
| 4891 | return; |
| 4892 | } |
| 4893 | if let Some(children) = object.get_mut("children").and_then(Value::as_array_mut) { |
| 4894 | for child in children { |
| 4895 | trim_node_depth(child, depth + 1, max_depth); |
| 4896 | } |
| 4897 | } |
| 4898 | } |
| 4899 | |
| 4900 | fn empty_accessibility_tree( |
| 4901 | source: &str, |
no test coverage detected