Fix typo in documentation for map_values (#3035)
* Fix typo in documentation for map_values "map_value(f)" -> "map_values(f)" * map_value => map_values also in the devolpment manual --------- Co-authored-by: Emanuele Torre <torreemanuele6@gmail.com>
This commit is contained in:
1 parent
54cc15c127
commit
92d35378ff
3 files changed
+4
-4
No files matched your search
@@ -1007,7 +1007,7 @@ sections:
|
|||||||
`($x|f)` for each value, $x, in the input array or object,
|
`($x|f)` for each value, $x, in the input array or object,
|
||||||
but `map_values(f)` only uses `first($x|f)`.
|
but `map_values(f)` only uses `first($x|f)`.
|
||||||
|
|
||||||
Specifically, for object inputs, `map_value(f)` constructs
|
Specifically, for object inputs, `map_values(f)` constructs
|
||||||
the output object by examining in turn the value of
|
the output object by examining in turn the value of
|
||||||
`first(.[$k]|f)` for each key, $k, of the input. If this
|
`first(.[$k]|f)` for each key, $k, of the input. If this
|
||||||
expression produces no values, then the corresponding key
|
expression produces no values, then the corresponding key
|
||||||
|
|||||||
@@ -1007,7 +1007,7 @@ sections:
|
|||||||
`($x|f)` for each value, $x, in the input array or object,
|
`($x|f)` for each value, $x, in the input array or object,
|
||||||
but `map_values(f)` only uses `first($x|f)`.
|
but `map_values(f)` only uses `first($x|f)`.
|
||||||
|
|
||||||
Specifically, for object inputs, `map_value(f)` constructs
|
Specifically, for object inputs, `map_values(f)` constructs
|
||||||
the output object by examining in turn the value of
|
the output object by examining in turn the value of
|
||||||
`first(.[$k]|f)` for each key, $k, of the input. If this
|
`first(.[$k]|f)` for each key, $k, of the input. If this
|
||||||
expression produces no values, then the corresponding key
|
expression produces no values, then the corresponding key
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
.
|
.
|
||||||
.TH "JQ" "1" "January 2024" "" ""
|
.TH "JQ" "1" "February 2024" "" ""
|
||||||
.
|
.
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
\fBjq\fR \- Command\-line JSON processor
|
\fBjq\fR \- Command\-line JSON processor
|
||||||
@@ -1004,7 +1004,7 @@ When the input to \fBmap_values(f)\fR is an object, the output object has the sa
|
|||||||
The key difference between \fBmap(f)\fR and \fBmap_values(f)\fR is that the former simply forms an array from all the values of \fB($x|f)\fR for each value, $x, in the input array or object, but \fBmap_values(f)\fR only uses \fBfirst($x|f)\fR\.
|
The key difference between \fBmap(f)\fR and \fBmap_values(f)\fR is that the former simply forms an array from all the values of \fB($x|f)\fR for each value, $x, in the input array or object, but \fBmap_values(f)\fR only uses \fBfirst($x|f)\fR\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Specifically, for object inputs, \fBmap_value(f)\fR constructs the output object by examining in turn the value of \fBfirst(\.[$k]|f)\fR for each key, $k, of the input\. If this expression produces no values, then the corresponding key will be dropped; otherwise, the output object will have that value at the key, $k\.
|
Specifically, for object inputs, \fBmap_values(f)\fR constructs the output object by examining in turn the value of \fBfirst(\.[$k]|f)\fR for each key, $k, of the input\. If this expression produces no values, then the corresponding key will be dropped; otherwise, the output object will have that value at the key, $k\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Here are some examples to clarify the behavior of \fBmap\fR and \fBmap_values\fR when applied to arrays\. These examples assume the input is \fB[1]\fR in all cases:
|
Here are some examples to clarify the behavior of \fBmap\fR and \fBmap_values\fR when applied to arrays\. These examples assume the input is \fB[1]\fR in all cases:
|
||||||
|
|||||||
Reference in new issue
Block a user