3 ms·
In fact, jq already has `map`, which would replace the article's pattern of `[.[]|add]` with `map(add)`. It is defined as such: def map(f): [.[] | f]; Man
by aarchi 4y ago
In fact, jq already has `map`, which would replace the article's pattern of `[.[]|add]` with `map(add)`. It is defined as such:
def map(f): [.[] | f];
Many built-in functions in jq are implemented in jq, in terms of a small set of core primitives. The implementations can be inspected in builtin.jq.
https://github.com/stedolan/jq/blob/master/src/builtin.jq#L3 https://github.com/stedolan/jq/blob/master/src/builtin.jq#L3