Whether a single (flat) hook entry's command field contains `prefix`.
(entry: &Value, prefix: &str)
| 296 | |
| 297 | /// Whether a single (flat) hook entry's command field contains `prefix`. |
| 298 | fn entry_command_contains(entry: &Value, prefix: &str) -> bool { |
| 299 | COMMAND_KEYS.iter().any(|key| { |
| 300 | entry |
| 301 | .get(key) |
| 302 | .and_then(Value::as_str) |
| 303 | .is_some_and(|cmd| cmd.contains(prefix)) |
| 304 | }) |
| 305 | } |
| 306 | |
| 307 | /// Whether a single (flat) hook entry carries any command field. |
| 308 | fn entry_has_command(entry: &Value) -> bool { |
no test coverage detected