Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keys_unsorted #81

Merged
merged 1 commit into from
Jun 26, 2023
Merged

Add keys_unsorted #81

merged 1 commit into from
Jun 26, 2023

Conversation

baodrate
Copy link
Contributor

To match jq, rename keys to keys_unsorted and implement keys as a std filter based on keys_unsorted. keys now returns the array of keys sorted

@baodrate
Copy link
Contributor Author

Also note that while jq specifies that sorting is only performed if the input is an object. That could be enforced in the filter definition but I opted to keep the definition simple.

To match jq, rename `keys` to `keys_unsorted` and implement `keys` as a
std filter based on `keys_unsorted`.
@01mf02 01mf02 merged commit 00ed64b into 01mf02:main Jun 26, 2023
@01mf02
Copy link
Owner

01mf02 commented Jun 26, 2023

That looks good, thanks! Let's keep your simple filter definition, as I suppose that keys is used mostly on objects anyway.

@baodrate baodrate deleted the keys_unsorted branch July 7, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants