MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / num_arg

Function num_arg

nodedb-query/src/functions/shared.rs:19–22  ·  view source on GitHub ↗

Extract a numeric argument with bool coercion.

(args: &[Value], idx: usize)

Source from the content-addressed store, hash-verified

17
18/// Extract a numeric argument with bool coercion.
19pub fn num_arg(args: &[Value], idx: usize) -> Option<f64> {
20 args.get(idx)
21 .and_then(|v| crate::value_ops::value_to_f64(v, true))
22}
23
24/// Check if the first arg is a string matching a predicate.
25pub fn bool_id_check(args: &[Value], check: impl Fn(&str) -> bool) -> Value {

Callers 3

try_evalFunction · 0.70
try_evalFunction · 0.70
try_evalFunction · 0.70

Calls 2

value_to_f64Function · 0.85
getMethod · 0.45

Tested by

no test coverage detected