mirror of
https://github.com/stedolan/jq.git
synced 2024-05-11 05:55:39 +00:00
Keep object keys in parsing order in tostream
output
As noted by @nicowilliams, `tostream` used `keys`, which sorts the keys in alphabetical order, instead of `keys_unsorted`, which preserves the parsing order. Fixes #1541.
This commit is contained in:
Eric Bréchemier
committed by
Nico Williams
parent
239278fd3a
commit
476b36770d
1
AUTHORS
1
AUTHORS
@ -24,6 +24,7 @@ David R. MacIver <david@drmaciver.com> - bug fixes
|
||||
David Tolnay <dtolnay@gmail.com> - destructuring, build improvements
|
||||
Doug Luce <doug@github.con.com> - build
|
||||
Eiichi Sato <sato.eiichi@gmail.com>
|
||||
Eric Bréchemier <eric@egull.co> - bug fix
|
||||
Filippo Giunchedi <fgiunchedi@gmail.com> - bug fixes
|
||||
Filippo Valsorda <filippo.valsorda@gmail.com> - recursive object merge (`*`)
|
||||
Hanfei Shen <qqshfox@gmail.com>
|
||||
|
@ -237,7 +237,7 @@ def tostream:
|
||||
else
|
||||
# We really need a _streaming_ form of `keys`.
|
||||
# We can use `range` for arrays, but not for objects.
|
||||
keys as $keys |
|
||||
keys_unsorted as $keys |
|
||||
$keys[-1] as $last|
|
||||
((# for each key
|
||||
$keys[] | . as $key |
|
||||
|
Reference in New Issue
Block a user