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

Function count_commands

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

Count the hook commands carried by a single entry (nested or flat).

(entry: &Value)

Source from the content-addressed store, hash-verified

305
306/// Count the hook commands carried by a single entry (nested or flat).
307fn count_commands(entry: &Value) -> usize {
308 if let Some(inner) = entry.get("hooks").and_then(Value::as_array) {
309 return inner.iter().filter(|h| entry_has_command(h)).count();
310 }
311 usize::from(entry_has_command(entry))
312}
313
314/// Deep-merge `extra` into `root`: objects merge recursively, arrays union by
315/// value (no duplicates), scalars overwrite. Used for non-hook settings such

Callers 1

install_from_manifestFunction · 0.85

Calls 4

entry_has_commandFunction · 0.85
getMethod · 0.65
countMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected