]> granicus.if.org Git - jq/commitdiff
from-entries should work with EC2 (fix #592)
authorNicolas Williams <nico@cryptonector.com>
Fri, 3 Oct 2014 22:35:01 +0000 (17:35 -0500)
committerNicolas Williams <nico@cryptonector.com>
Fri, 3 Oct 2014 22:47:13 +0000 (17:47 -0500)
builtin.c

index 0c0faa3154bceba415da657c41bb225b5ac3b547..4dc34a593debe47cab4674b03796f7501dbf2c75 100644 (file)
--- a/builtin.c
+++ b/builtin.c
@@ -970,7 +970,7 @@ static const char* const jq_builtins[] = {
   "def recurse_down: recurse;",
 
   "def to_entries: [keys_unsorted[] as $k | {key: $k, value: .[$k]}];",
-  "def from_entries: map({(.key): .value}) | add | .//={};",
+  "def from_entries: map({(.key // .Key): (.value // .Value)}) | add | .//={};",
   "def with_entries(f): to_entries | map(f) | from_entries;",
   "def reverse: [.[length - 1 - range(0;length)]];",
   "def indices($i): if type == \"array\" and ($i|type) == \"array\" then .[$i] elif type == \"array\" then .[[$i]] else .[$i] end;",