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

Function entry_has_command

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

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

(entry: &Value)

Source from the content-addressed store, hash-verified

306
307/// Whether a single (flat) hook entry carries any command field.
308fn entry_has_command(entry: &Value) -> bool {
309 COMMAND_KEYS
310 .iter()
311 .any(|key| entry.get(key).and_then(Value::as_str).is_some())
312}
313
314/// Remove hook entries whose command contains `prefix`. Handles both nested
315/// (`{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