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:
1 parent
239278fd3a
commit
476b36770d
2 files changed
+2
-1
No files matched your search
@@ -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>
|
||||
|
||||
+1
-1
@@ -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