(content: &Value)
| 1027 | } |
| 1028 | |
| 1029 | fn count_cache_controls_in_content(content: &Value) -> usize { |
| 1030 | match content { |
| 1031 | Value::Array(items) => items |
| 1032 | .iter() |
| 1033 | .filter(|item| block_has_direct_cache_control(item)) |
| 1034 | .count(), |
| 1035 | Value::Object(map) => usize::from( |
| 1036 | map.contains_key("cache_control") && block_supports_direct_cache_control(map), |
| 1037 | ), |
| 1038 | _ => 0, |
| 1039 | } |
| 1040 | } |
| 1041 | |
| 1042 | fn block_has_direct_cache_control(block: &Value) -> bool { |
| 1043 | block.as_object().is_some_and(|map| { |
no test coverage detected