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

Function entry_command_contains

atomic-agent/src/hooks/manifest.rs:260–267  ·  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

258
259/// Whether a single (flat) hook entry's command field contains `prefix`.
260fn entry_command_contains(entry: &Value, prefix: &str) -> bool {
261 COMMAND_KEYS.iter().any(|key| {
262 entry
263 .get(key)
264 .and_then(Value::as_str)
265 .is_some_and(|cmd| cmd.contains(prefix))
266 })
267}
268
269/// Whether a single (flat) hook entry carries any command field.
270fn 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