Skip to content
Myr

Rewrite `_assign/2` using `$argument` syntax

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

authored by Muh Muhten · committed by Nico Williams · parent 85caac4 · Browse files · 1 file+1 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+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/builtin.jq+1 added-1 removed
8 unmodified lines
9def max_by(f): _max_by_impl(map([f]));10def min_by(f): _min_by_impl(map([f]));11def add: reduce .[] as $x (null; . + $x);12def del(f): delpaths([path(f)]);13def _assign(paths; value): value as $v | reduce path(paths) as $p (.; setpath($p; $v));13def _assign(paths; $value): reduce path(paths) as $p (.; setpath($p; $value));14def _modify(paths; update): reduce path(paths) as $p (.; label $out | (setpath($p; getpath($p) | update) | ., break $out), delpaths([$p]));15def map_values(f): .[] |= f;1617# recurse
296 unmodified lines