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

This commit is contained in:
itchyny authored and GitHub committed 2026-04-02 22:04:51 +09:00
1 parent 847b6afd2c
commit 69785bf77f
1 file changed
+2 -1
+2 -1
View File
@@ -39,7 +39,8 @@ def recurse(f; cond): def r: ., (f | select(cond) | r); r;
def recurse: recurse(.[]?);
def to_entries: [keys_unsorted[] as $k | {key: $k, value: .[$k]}];
def from_entries: map({(.key // .Key // .name // .Name): (if has("value") then .value else .Value end)}) | add | .//={};
def from_entries: map({ (.key // .Key // .name // .Name):
if has("value") then .value else .Value end }) | 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]