Count the hook commands carried by a single entry (nested or flat).
(entry: &Value)
| 305 | |
| 306 | /// Count the hook commands carried by a single entry (nested or flat). |
| 307 | fn count_commands(entry: &Value) -> usize { |
| 308 | if let Some(inner) = entry.get("hooks").and_then(Value::as_array) { |
| 309 | return inner.iter().filter(|h| entry_has_command(h)).count(); |
| 310 | } |
| 311 | usize::from(entry_has_command(entry)) |
| 312 | } |
| 313 | |
| 314 | /// Deep-merge `extra` into `root`: objects merge recursively, arrays union by |
| 315 | /// value (no duplicates), scalars overwrite. Used for non-hook settings such |
no test coverage detected