Implement add/1 (#3144)
This commit is contained in:
1 parent
137018d2ae
commit
0b5ae30f19
5 files changed
+35
-4
No files matched your search
+2
-1
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user