Skip to content
Myr

Use `//` instead of `//=` in from_entries definition (#3516)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by itchyny · committed by GitHub · parent 847b6af · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:src/builtin.jq+2 added-1 removed
37 unmodified lines
38def recurse(f; cond): def r: ., (f | select(cond) | r); r;39def recurse: recurse(.[]?);4041def to_entries: [keys_unsorted[] as $k | {key: $k, value: .[$k]}];42def from_entries: map({(.key // .Key // .name // .Name): (if has("value") then .value else .Value end)}) | add | .//={};42def from_entries: map({ (.key // .Key // .name // .Name):43 if has("value") then .value else .Value end }) | add // {};44def with_entries(f): to_entries | map(f) | from_entries;45def reverse: [.[length - 1 - range(0;length)]];46def indices($i): if type == "array" and ($i|type) == "array" then .[$i]47 elif type == "array" then .[[$i]]
197 unmodified lines