-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
from_entries of [] is null, should be {} #280
Comments
I too think it's a bug.
and
The problem is the In the meantime you can work around this by defining your own |
I.e., the workaround should be to add this to your program:
That will probably be the fix too (in builtin.c). |
Or more simply, if I understand correctly: "def from_entries: map({(.key): .value}) | add | .//={};", |
Even |
Oops, I missed this for the 1.4 release. |
jq version 1.3
rachel@dudley stanley$ echo '[]' | jq -M 'from_entries'
null
rachel@dudley stanley$
For consistency, I expected {}.
The man page doesn't say anything about this inconsistency, so it sounds like a bug.
The text was updated successfully, but these errors were encountered: