Added all and any builtins
This commit is contained in:
1 parent
1fa55a3fae
commit
8b41415b07
2 files changed
+42
No files matched your search
@@ -680,6 +680,8 @@ static const char* const jq_builtins[] = {
|
||||
"def rindex(i): .[i][-1:][0];",
|
||||
"def paths: path(recurse(if (type|. == \"array\" or . == \"object\") then .[] else empty end))|select(length > 0);",
|
||||
"def leaf_paths: . as $dot|paths|select(. as $p|$dot|getpath($p)|type|. != \"array\" and . != \"object\");",
|
||||
"def any: reduce .[] as $i (false; . or $i);",
|
||||
"def all: reduce .[] as $i (true; . and $i);",
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user