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

to_entries should not sort keys (fix #561)

This commit is contained in:
Nicolas Williams
2014-09-30 21:49:37 -05:00
parent f7a2af7052
commit 4a57b84db0
4 changed files with 28 additions and 2 deletions

View File

@@ -588,7 +588,7 @@ sections:
input: '[[1,2], "string", {"a":2}, null]'
output: [2, 6, 1, 0]
- title: "`keys`"
- title: "`keys`, `keys_unsorted`"
body: |
The builtin function `keys`, when given an object, returns
@@ -603,6 +603,10 @@ sections:
When `keys` is given an array, it returns the valid indices
for that array: the integers from 0 to length-1.
The `keys_unsorted` function is just like `keys`, but if
the input is an object then the keys will not be sorted,
instead the keys will roughly be in insertion order.
examples:
- program: 'keys'
input: '{"abc": 1, "abcd": 2, "Foo": 3}'