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
+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