Whether a single (flat) hook entry carries any command field.
(entry: &Value)
| 268 | |
| 269 | /// Whether a single (flat) hook entry carries any command field. |
| 270 | fn entry_has_command(entry: &Value) -> bool { |
| 271 | COMMAND_KEYS |
| 272 | .iter() |
| 273 | .any(|key| entry.get(key).and_then(Value::as_str).is_some()) |
| 274 | } |
| 275 | |
| 276 | /// Remove hook entries whose command contains `prefix`. Handles both nested |
| 277 | /// (`{matcher?, hooks: [{command}]}`) and flat (`{command}`/`{bash}`) shapes. |
no test coverage detected