Implement add/1 (#3144)

This commit is contained in:
myaaaaaaaaa authored and GitHub committed 2024-08-20 21:02:24 +09:00
1 parent 137018d2ae
commit 0b5ae30f19
5 files changed
+35 -4

No files matched your search

+2 -1
View File
@@ -8,7 +8,8 @@ def unique: group_by(.) | map(.[0]);
def unique_by(f): group_by(f) | map(.[0]);
def max_by(f): _max_by_impl(map([f]));
def min_by(f): _min_by_impl(map([f]));
def add: reduce .[] as $x (null; . + $x);
def add(f): reduce f as $x (null; . + $x);
def add: add(.[]);
def del(f): delpaths([path(f)]);
def abs: if . < 0 then - . else . end;
def _assign(paths; $value): reduce path(paths) as $p (.; setpath($p; $value));