Add any/N and all/N x N in (1, 2) (fix #455)
Contributed by @pkoppstein.
This commit is contained in:
1 parent
5a863bf010
commit
821cd31e67
2 files changed
+18
-2
No files matched your search
@@ -934,6 +934,10 @@ static const char* const jq_builtins[] = {
|
||||
"def paths(node_filter): . as $dot|paths|select(. as $p|$dot|getpath($p)|node_filter);",
|
||||
"def any: reduce .[] as $i (false; . or $i);",
|
||||
"def all: reduce .[] as $i (true; . and $i);",
|
||||
"def any(condition): reduce .[] as $i (false; . or ($i|condition));",
|
||||
"def all(condition): reduce .[] as $i (true; . and ($i|condition));",
|
||||
"def any(generator; condition): reduce generator as $i (false; . or ($i|condition));",
|
||||
"def all(generator; condition): reduce generator as $i (true; . and ($i|condition));",
|
||||
"def arrays: select(type == \"array\");",
|
||||
"def objects: select(type == \"object\");",
|
||||
"def iterables: arrays, objects;",
|
||||
|
||||
Reference in new issue
Block a user