diff options
author | Santiago Lapresta <santiago.lapresta@gmail.com> | 2014-02-17 04:01:32 +0100 |
---|---|---|
committer | Santiago Lapresta <santiago.lapresta@gmail.com> | 2014-02-17 04:01:32 +0100 |
commit | 8b41415b071225c8ff25cb7938ed19e258cc8827 (patch) | |
tree | f9720a6e74bc5e28db0aa8acce8a019c1e8484ab /builtin.c | |
parent | 1fa55a3fae3dc6b8a2018ce64786b5b5570fde70 (diff) |
Added `all` and `any` builtins
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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);", }; |