Fix cut-n-paste in leaf_paths; doc and test 'em
This commit is contained in:
1 parent
a45c937f80
commit
1fa55a3fae
3 files changed
+39
-1
No files matched your search
@@ -679,7 +679,7 @@ static const char* const jq_builtins[] = {
|
||||
"def index(i): .[i][0];",
|
||||
"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\" or . == \"object\");",
|
||||
"def leaf_paths: . as $dot|paths|select(. as $p|$dot|getpath($p)|type|. != \"array\" and . != \"object\");",
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user