Skip to content

Commit 730c730

Browse files
muhmuhtennicowilliams
authored andcommitted
Rewrite _assign/2 using $argument syntax
1 parent 85caac4 commit 730c730

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/builtin.jq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def max_by(f): _max_by_impl(map([f]));
1010
def min_by(f): _min_by_impl(map([f]));
1111
def add: reduce .[] as $x (null; . + $x);
1212
def del(f): delpaths([path(f)]);
13-
def _assign(paths; value): value as $v | reduce path(paths) as $p (.; setpath($p; $v));
13+
def _assign(paths; $value): reduce path(paths) as $p (.; setpath($p; $value));
1414
def _modify(paths; update): reduce path(paths) as $p (.; label $out | (setpath($p; getpath($p) | update) | ., break $out), delpaths([$p]));
1515
def map_values(f): .[] |= f;
1616

0 commit comments

Comments
 (0)