MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / entry_has_command

Function entry_has_command

atomic-agent/src/hooks/manifest.rs:270–274  ·  view source on GitHub ↗

Whether a single (flat) hook entry carries any command field.

(entry: &Value)

Source from the content-addressed store, hash-verified

268
269/// Whether a single (flat) hook entry carries any command field.
270fn 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.

Callers 1

count_commandsFunction · 0.85

Calls 2

getMethod · 0.65
iterMethod · 0.45

Tested by

no test coverage detected