Skip to content
Myr

Fix typo in documentation for map_values (#3035)

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

* Fix typo in documentation for map_values "map_value(f)" -> "map_values(f)" * map_value => map_values also in the devolpment manual ---------

authored by J. B. Rainsberger · committed by GitHub · parent 54cc15c · Browse files · 3 files+4 added−4 removed
This commit

State

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

Trailers

  • Co-authored-by: Emanuele Torre <torreemanuele6@gmail.com>

Diff stats

3 files+4 added−4 removed

  • other:+4 added−4 removed

3 files+4 added−4 removed

modified:docs/content/manual/v1.7/manual.yml+1 added-1 removed
1005 unmodified lines
1006 that the former simply forms an array from all the values of1007 `($x|f)` for each value, $x, in the input array or object,1008 but `map_values(f)` only uses `first($x|f)`.10091010 Specifically, for object inputs, `map_value(f)` constructs1010 Specifically, for object inputs, `map_values(f)` constructs1011 the output object by examining in turn the value of1012 `first(.[$k]|f)` for each key, $k, of the input. If this1013 expression produces no values, then the corresponding key1014 will be dropped; otherwise, the output object will have that
2688 unmodified lines
modified:docs/content/manual/manual.yml+1 added-1 removed
1005 unmodified lines
1006 that the former simply forms an array from all the values of1007 `($x|f)` for each value, $x, in the input array or object,1008 but `map_values(f)` only uses `first($x|f)`.10091010 Specifically, for object inputs, `map_value(f)` constructs1010 Specifically, for object inputs, `map_values(f)` constructs1011 the output object by examining in turn the value of1012 `first(.[$k]|f)` for each key, $k, of the input. If this1013 expression produces no values, then the corresponding key1014 will be dropped; otherwise, the output object will have that
2749 unmodified lines
modified:jq.1.prebuilt+2 added-2 removed
1.2.TH "JQ" "1" "January 2024" "" ""2.TH "JQ" "1" "February 2024" "" ""3.4.SH "NAME"5\fBjq\fR \- Command\-line JSON processor6.
996 unmodified lines
1003.P1004The 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\.1005.1006.P1007Specifically, 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\.1007Specifically, 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\.1008.1009.P1010Here 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:1011.
3188 unmodified lines