Use unsorted keys in walk
Preserve key sorting order when executing in walk, if sorted keys is desired `--sort-keys` should be used to explicitly obtain sorted keys.
This commit is contained in:
1 parent
6d89e297fe
commit
ca12bd9b5d
1 file changed
+1
-1
+1
-1
@@ -284,7 +284,7 @@ def bsearch(target):
|
|||||||
def walk(f):
|
def walk(f):
|
||||||
. as $in
|
. as $in
|
||||||
| if type == "object" then
|
| if type == "object" then
|
||||||
reduce keys[] as $key
|
reduce keys_unsorted[] as $key
|
||||||
( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f
|
( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f
|
||||||
elif type == "array" then map( walk(f) ) | f
|
elif type == "array" then map( walk(f) ) | f
|
||||||
else f
|
else f
|
||||||
|
|||||||
Reference in new issue
Block a user