From 9dd7b419712e910c12de8a8db0a94d27ad5697d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 26 Jul 2023 04:47:01 +0000 Subject: Update website --- manual/index.html | 409 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 225 insertions(+), 184 deletions(-) diff --git a/manual/index.html b/manual/index.html index ba1f9b22..b9497ba4 100644 --- a/manual/index.html +++ b/manual/index.html @@ -1658,6 +1658,45 @@ the same strategy.

+
+

+ abs + +

+

The builtin function abs is defined naively as: if . < 0 then - . else . end.

+

For numeric input, this is the absolute value. See the +section on the identity filter for the implications of this +definition for numeric input.

+

To compute the absolute value of a number as a floating point number, you may wish use fabs.

+ + +
+ + + + Example + +
+ + + + + + + + + + + + + +
jq 'map(abs)'
Input[-10, -1.1, -1e-1]
Output[10,1.1,1e-1]
+ +
+
+ +
+

length @@ -1691,11 +1730,11 @@ different types of value:

- + Example -
+
@@ -1755,11 +1794,11 @@ bytes used to encode a string in UTF-8.

jq '.[] | length'
@@ -1801,11 +1840,11 @@ instead the keys will roughly be in insertion order.

jq 'utf8bytelength'
@@ -1855,11 +1894,11 @@ will be faster.

jq 'keys'
@@ -1907,11 +1946,11 @@ of has.

jq 'map(has("foo"))'
@@ -1996,11 +2035,11 @@ map_values(empty) #=> []
jq '.[] | in({"foo": 42})'
@@ -2076,11 +2115,11 @@ For arrays, negative indices and .[m:n] specifications should not be used.

jq 'map(.+1)'
@@ -2140,11 +2179,11 @@ boolean values in ., and only those paths.

jq 'pick(.a, .b.c, .x)'
@@ -2190,11 +2229,11 @@ value from an object.

jq 'path(.a[0].b)'
@@ -2240,11 +2279,11 @@ at each path in PATHS.

jq 'del(.foo)'
@@ -2289,11 +2328,11 @@ at each path in PATHS.

jq 'getpath(["a","b"])'
@@ -2354,11 +2393,11 @@ of strings and numbers.

jq 'setpath(["a","b"]; 1)'
@@ -2397,11 +2436,11 @@ doing some operation to all keys and values of an object.
jq 'delpaths([["a","b"]])'
@@ -2464,11 +2503,11 @@ will give you [2,3].

jq 'to_entries'
@@ -2516,11 +2555,11 @@ non-iterables, respectively.

jq 'map(select(. >= 2))'
@@ -2552,11 +2591,11 @@ non-iterables, respectively.

jq '.[]|numbers'
@@ -2613,11 +2652,11 @@ emit [].

jq '1, empty, 2'
@@ -2690,11 +2729,11 @@ values.

jq 'try error catch .'
@@ -2730,11 +2769,11 @@ values.

jq 'try error("\($__loc__)") catch .'
@@ -2784,11 +2823,11 @@ as those for the + operator (described above).

jq '[paths]'
@@ -2854,11 +2893,11 @@ condition to all the outputs of the given generator.

jq 'add'
@@ -2924,11 +2963,11 @@ condition to all the outputs of the given generator.

jq 'any'
@@ -2992,11 +3031,11 @@ levels deep.

jq 'all'
@@ -3078,11 +3117,11 @@ with an increment of by.

jq 'flatten'
@@ -3190,11 +3229,11 @@ with an increment of by.

jq 'range(2; 4)'
@@ -3225,11 +3264,11 @@ with an increment of by.

jq 'floor'
@@ -3262,11 +3301,11 @@ equivalent, leave numbers alone, and give an error on all other input.

jq 'sqrt'
@@ -3306,11 +3345,11 @@ JSON-encoded.

jq '.[] | tonumber'
@@ -3357,11 +3396,11 @@ or object.

jq '.[] | tostring'
@@ -3401,11 +3440,11 @@ NaNs, and sub-normals do not raise errors.

jq 'map(type)'
@@ -3484,11 +3523,11 @@ equal, and so on.

jq '.[] | (infinite * .) < 0'
@@ -3553,11 +3592,11 @@ in the sort function above.

jq 'sort'
@@ -3591,11 +3630,11 @@ you to specify a particular field or property to examine, e.g.
jq 'group_by(.foo)'
@@ -3646,11 +3685,11 @@ produced by group.

jq 'min'
@@ -3709,11 +3748,11 @@ produced by group.

jq 'unique'
@@ -3751,11 +3790,11 @@ be contained in each other if they are equal.

jq 'reverse'
@@ -3845,11 +3884,11 @@ in . match those of s.

jq 'contains("bar")'
@@ -3909,11 +3948,11 @@ occurrence of s in the input.

jq 'indices(", ")'
@@ -4016,11 +4055,11 @@ inversed version of contains.

jq 'index(", ")'
@@ -4107,11 +4146,11 @@ inversed version of contains.

jq 'inside("foobar")'
@@ -4142,11 +4181,11 @@ inversed version of contains.

jq '[.[]|startswith("foo")]'
@@ -4179,11 +4218,11 @@ of n repetitions of the input array.

jq '[.[]|endswith("foo")]'
@@ -4271,11 +4310,11 @@ starts with it.

jq 'combinations'
@@ -4307,11 +4346,11 @@ ends with it.

jq '[.[]|ltrimstr("foo")]'
@@ -4343,11 +4382,11 @@ codepoint numbers.

jq '[.[]|rtrimstr("foo")]'
@@ -4378,11 +4417,11 @@ codepoint numbers.

jq 'explode'
@@ -4415,11 +4454,11 @@ two arguments (see the regular expressions section below).

jq 'implode'
@@ -4456,11 +4495,11 @@ in the input are not supported.

jq 'split(", ")'
@@ -4506,11 +4545,11 @@ converted to the specified case.

jq 'join(", ")'
@@ -4546,11 +4585,11 @@ output for each input. See advanced topics below.

jq 'ascii_upcase'
@@ -4586,11 +4625,11 @@ output for each input. See advanced topics below.

jq '[while(.<100; .*2)]'
@@ -4628,11 +4667,11 @@ output for each input. See advanced topics below.

jq '[repeat(.*2, error)?]'
@@ -4691,11 +4730,11 @@ input.

jq '[.,1]|until(.[0] < 1; [.[0] - 1, .[1] * .[0]])|.[1]'
@@ -4820,11 +4859,11 @@ input can be considered for alteration.

jq 'recurse(.foo[])'
@@ -4873,11 +4912,11 @@ variables.

jq 'walk(if type == "array" then sort else . end)'
@@ -4923,11 +4962,11 @@ Rows are padded with nulls so the result is always rectangular.

jq '$ENV.PAGER'
@@ -4965,11 +5004,11 @@ interest.

jq 'transpose'
@@ -5030,11 +5069,11 @@ interpolated into the string.

jq 'bsearch(0)'
@@ -5068,11 +5107,11 @@ unmodified, while tojson encodes strings as JSON strings.

jq '"The input was \(.), which is one less than \(.+1)"'
@@ -5197,11 +5236,11 @@ not escaped, as they were part of the string literal.

jq '[.[]|tostring]'
@@ -5319,11 +5358,11 @@ some systems. In particular, the %u and %j specifiers
jq '@html'
@@ -5452,11 +5491,11 @@ JavaScript's ===, the "strict equality" operator.

jq 'fromdate'
@@ -5551,11 +5590,11 @@ once for each false or null.

jq '. == false'
jq 'if . == 0 then @@ -5596,11 +5635,11 @@ to, less than or equal to or less than their right argument
- + Example -
+
@@ -5646,11 +5685,11 @@ evaluating a condition, see the // operator below.

jq '. < 5'
@@ -5758,11 +5797,11 @@ operations).

jq '42 and "a string"'
@@ -5812,11 +5851,11 @@ expression to try.

jq '.foo // 42'
@@ -5907,11 +5946,11 @@ is lexical: the label has to be "visible" from the break.

jq 'try .a catch ". is not an object"'
@@ -6002,11 +6041,11 @@ for whether or not the regex matches the input.

jq '[.[] | .a?]'
@@ -6073,11 +6112,11 @@ the following fields:

jq 'test("foo")'
@@ -6187,11 +6226,11 @@ corresponding value.

jq 'match("(abc)+"; "g")'
@@ -6226,11 +6265,11 @@ To capture all the matches for each input string, use the idiom
jq 'capture("(?<a>[a-z]+)-(?<n>[0-9]+)")'
@@ -6270,11 +6309,11 @@ To capture all the matches for each input string, use the idiom
jq 'scan("c")'
@@ -6306,11 +6345,11 @@ but as a stream instead of an array.

jq 'split(", *"; null)'
@@ -6369,11 +6408,11 @@ would take the form: "\(.x)".

jq 'splits(", *")'
@@ -6420,11 +6459,11 @@ of jq strings, then gsub will produce a corresponding stream of JSO
jq 'sub("[^a-z]*(?<x>[a-z]+)"; "Z\(.x)"; "g")'
@@ -6561,11 +6600,11 @@ will not be visible where the old one was.

jq 'gsub("(?<x>.)[^a]*"; "+\(.x)-")'
@@ -6677,11 +6716,11 @@ that occur during the final alternative are passed through.

jq '.bar as $x | .foo | . + $x'
@@ -6792,11 +6831,11 @@ See also the section below on scoping.

jq '.[] as {$a, $b, c: {$d, $e}} ?// {$a, $b, c: [{$d, $e}]} | {$a, $b, $d, $e}'
@@ -6862,11 +6901,11 @@ $times_three | [. + $times_three]) | ...: here the binding
jq 'def addvalue(f): . + [f]; map(addvalue(.[0]))'
@@ -6925,11 +6964,11 @@ $times_three | [. + $times_three]) | ...: here the binding
jq 'isempty(empty)'
@@ -6963,11 +7002,11 @@ Note that nth(n; expr) doesn't support negative values of n - + Example -
+
jq '[limit(3;.[])]'
@@ -7000,11 +7039,11 @@ and last values from any array at ..

jq '[first(range(.)), last(range(.)), nth(./2; range(.))]'
@@ -7048,11 +7087,11 @@ so the effect is similar to running something like this:

jq '[range(.)]|[first, last, nth(5)]'
@@ -7129,11 +7168,11 @@ That is, it outputs the intermediate values as they are.

jq 'reduce .[] as $item (0; . + $item)'
@@ -7312,11 +7351,11 @@ generator construction, and sub-functions.

jq 'foreach .[] as $item (0; . + $item)'
@@ -7548,11 +7587,11 @@ given streaming expression.

-
jq 'def range(init; upto; by): def _range: if (by > 0 and . < upto) or (by < 0 and . > upto) then ., ((.+by)|_range) else . end; if by == 0 then init else init|_range end | select((by > 0 and . < upto) or (by < 0 and . > upto)); range(0; 10; 3)'