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:
@@ -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
|
||||
|
Reference in New Issue
Block a user