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

Function entry_command_contains

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

Whether a single (flat) hook entry's command field contains `prefix`.

(entry: &Value, prefix: &str)

Source from the content-addressed store, hash-verified

296
297/// Whether a single (flat) hook entry's command field contains `prefix`.
298fn 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.
308fn entry_has_command(entry: &Value) -> bool {

Callers 1

remove_prefixedFunction · 0.85

Calls 3

getMethod · 0.65
iterMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected