1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

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:
Jonathan Word
2017-05-03 15:49:21 -04:00
committed by GitHub
parent 6d89e297fe
commit ca12bd9b5d

View File

@@ -284,7 +284,7 @@ def bsearch(target):
def walk(f):
. as $in
| if type == "object" then
reduce keys[] as $key
reduce keys_unsorted[] as $key
( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f
elif type == "array" then map( walk(f) ) | f
else f