From aac8132f47435ef2d44411df327d90350e92bef6 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 27 Jan 2017 15:51:06 -0600 Subject: [PATCH] recurse (i.e., ..) needs to find leaf nulls --- src/builtin.jq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtin.jq b/src/builtin.jq index 223cdca..d6cd432 100644 --- a/src/builtin.jq +++ b/src/builtin.jq @@ -14,7 +14,7 @@ def _modify(paths; update): reduce path(paths) as $p (.; setpath($p; getpath($p) def map_values(f): .[] |= f; # recurse -def recurse(f): def r: ., (f | select(. != null) | r); r; +def recurse(f): def r: ., (f | r); r; def recurse(f; cond): def r: ., (f | select(cond) | r); r; def recurse: recurse(.[]?); def recurse_down: recurse; -- 2.40.0