Skip to content

Commit 2a30796

Browse files
kgryteNeerajpathak07
authored andcommitted
chore: clean-up documentation and fix tests
Ref: stdlib-js#1705 Ref: stdlib-js@23e158b --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent bf885d8 commit 2a30796

File tree

13 files changed

+88
-101
lines changed

13 files changed

+88
-101
lines changed

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# mskfilterMap
2222

23-
> Apply a mask to a provided input array and return a new array after applying a mapping function.
23+
> Apply a mask and a callback function to a provided input array.
2424
2525
<section class="usage">
2626

@@ -32,7 +32,7 @@ var mskfilterMap = require( '@stdlib/array/base/mskfilter-map' );
3232

3333
#### mskfilterMap( x, mask, clbk\[, thisArg] )
3434

35-
Applies a mask to a provided input array and returns a new array after applying a mapping function.
35+
Returns a new array after applying a mask and a callback function to a provided input array.
3636

3737
```javascript
3838
function clbk( value ) {
@@ -50,10 +50,10 @@ The function supports the following parameters:
5050

5151
- **x**: input array.
5252
- **mask**: mask array.
53-
- **clbk**: function to apply.
54-
- **thisArg**: applied function execution context (_optional_).
53+
- **clbk**: callback to apply.
54+
- **thisArg**: callback execution context (_optional_).
5555

56-
To set the applied function's execution context, provide a `thisArg`.
56+
To set the execution context of the callback function, provide a `thisArg`.
5757

5858
<!-- eslint-disable no-invalid-this -->
5959

@@ -81,7 +81,7 @@ The function **always** returns a new "generic" array.
8181

8282
#### mskfilterMap.assign( x, mask, out, stride, offset, clbk\[, thisArg] )
8383

84-
Applies a mask and mapping function to a provided input array and assigns results to elements in a provided output array.
84+
Applies a mask and a callback function to a provided input array and assigns results to elements in a provided output array.
8585

8686
```javascript
8787
function clbk( value ) {
@@ -106,8 +106,8 @@ The function supports the following parameters:
106106
- **out**: output array.
107107
- **stride**: output array stride.
108108
- **offset**: output array offset.
109-
- **clbk**: function to apply.
110-
- **thisArg**: applied function execution context (_optional_).
109+
- **clbk**: callback function.
110+
- **thisArg**: callback execution context (_optional_).
111111

112112
</section>
113113

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/benchmark/benchmark.assign.length.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var zeros = require( '@stdlib/array/zeros' );
2727
var ones = require( '@stdlib/array/ones' );
2828
var isArray = require( '@stdlib/assert/is-array' );
2929
var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive;
30-
var identity = require( '@stdlib/math/base/special/identity' );
30+
var identity = require( '@stdlib/utils/identity-function' );
3131
var pkg = require( './../package.json' ).name;
3232
var mskfilterMap = require( './../lib' );
3333

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/benchmark/benchmark.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var isArray = require( '@stdlib/assert/is-array' );
2525
var zeroTo = require( '@stdlib/array/base/zero-to' );
2626
var ones = require( '@stdlib/array/base/ones' );
27-
var identity = require( '@stdlib/math/base/special/identity' );
27+
var identity = require( '@stdlib/utils/identity-function' );
2828
var pkg = require( './../package.json' ).name;
2929
var mskfilterMap = require( './../lib' );
3030

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/benchmark/benchmark.length.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var pow = require( '@stdlib/math/base/special/pow' );
2525
var zeroTo = require( '@stdlib/array/base/zero-to' );
2626
var ones = require( '@stdlib/array/base/ones' );
2727
var isArray = require( '@stdlib/assert/is-array' );
28-
var identity = require( '@stdlib/math/base/special/identity' );
28+
var identity = require( '@stdlib/utils/identity-function' );
2929
var pkg = require( './../package.json' ).name;
3030
var mskfilterMap = require( './../lib' );
3131

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/docs/repl.txt

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
{{alias}}( x, mask, fcn[, thisArg] )
3-
Applies a mask to a provided input array and returns a new array after
4-
applying a mapping function.
2+
{{alias}}( x, mask, clbk[, thisArg] )
3+
Returns a new array after applying a mask and a callback function to a
4+
provided input array.
55

66
If a mask array element is truthy, the corresponding element in `x` is
77
included in the output array; otherwise, the corresponding element in `x`
@@ -15,11 +15,11 @@
1515
mask: ArrayLikeObject
1616
Mask array.
1717

18-
fcn: Function
18+
clbk: Function
1919
Function to apply.
2020

2121
thisArg: any (optional)
22-
Function execution context.
22+
Callback execution context.
2323

2424
Returns
2525
-------
@@ -33,8 +33,8 @@
3333
[ 2, 4 ]
3434

3535

36-
{{alias}}.assign( x, mask, out, stride, offset, fcn[, thisArg] )
37-
Applies a mask and mapping function to a provided input array and assigns
36+
{{alias}}.assign( x, mask, out, stride, offset, clbk[, thisArg] )
37+
Applies a mask and a callback function to a provided input array and assigns
3838
results to elements in a provided output array.
3939

4040
If a mask array element is truthy, the corresponding element in `x` is
@@ -58,11 +58,11 @@
5858
offset: integer
5959
Output array offset.
6060

61-
fcn: Function
61+
clbk: Function
6262
Function to apply.
6363

6464
thisArg: any (optional)
65-
Function execution context.
65+
Callback execution context.
6666

6767
Returns
6868
-------

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/docs/types/index.d.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { Array2D, Collection } from '@stdlib/types/array';
23+
import { Collection } from '@stdlib/types/array';
2424

2525
/**
2626
* Callback invoked for each array element.
@@ -41,7 +41,7 @@ type Unary<T, U, V> = ( this: V, value: T ) => U;
4141
* Callback invoked for each array element.
4242
*
4343
* @param value - array element
44-
* @param indices - current array element indices
44+
* @param index - current array element index
4545
* @returns result
4646
*/
4747
type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
@@ -50,17 +50,17 @@ type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;
5050
* Callback invoked for each array element.
5151
*
5252
* @param value - array element
53-
* @param indices - current array element indices
53+
* @param index - current array element index
5454
* @param array - input array
5555
* @returns result
5656
*/
57-
type Ternary<T, U, V> = ( this: V, value: T, index: number, array: Array2D<T> ) => U;
57+
type Ternary<T, U, V> = ( this: V, value: T, index: number, array: Collection<T> ) => U;
5858

5959
/**
6060
* Callback invoked for each array element.
6161
*
6262
* @param value - array element
63-
* @param indices - current array element indices
63+
* @param index - current array element index
6464
* @param array - input array
6565
* @returns result
6666
*/
@@ -71,12 +71,12 @@ type Callback<T, U, V> = Nullary<U, V> | Unary<T, U, V> | Binary<T, U, V> | Tern
7171
*/
7272
interface Routine {
7373
/**
74-
* Applies a mask to a provided input array and returns a new array after applying a mapping function.
74+
* Returns a new array after applying a mask and a callback function to a provided input array.
7575
*
7676
* @param x - input array
7777
* @param mask - mask array
78-
* @param clbk - callback to invoke
79-
* @param thisArg - execution context
78+
* @param clbk - callback function
79+
* @param thisArg - callback execution context
8080
* @returns output array
8181
*
8282
* @example
@@ -92,15 +92,15 @@ interface Routine {
9292
<T = unknown, U = unknown, V = unknown>( x: Collection<T>, mask: Collection, clbk: Callback<T, U, V>, thisArg?: ThisParameterType<Callback<T, U, V>> ): Array<U>;
9393

9494
/**
95-
* Applies a mask and mapping function to an input array and assigns results to elements in an output array.
95+
* Applies a mask and a callback function to an input array and assigns results to elements in an output array.
9696
*
9797
* @param x - input array
9898
* @param mask - mask array
9999
* @param out - output array
100100
* @param stride - output array stride
101101
* @param offset - output array offset
102-
* @param clbk - callback to invoke
103-
* @param thisArg - execution context
102+
* @param clbk - callback function
103+
* @param thisArg - callback execution context
104104
* @returns output array
105105
*
106106
* @example
@@ -123,12 +123,12 @@ interface Routine {
123123
}
124124

125125
/**
126-
* Applies a mask to a provided input array and returns a new array after applying a mapping function.
126+
* Returns a new array after applying a mask and a callback function to a provided input array.
127127
*
128128
* @param x - input array
129129
* @param mask - mask array
130-
* @param clbk - callback to invoke
131-
* @param thisArg - execution context
130+
* @param clbk - callback function
131+
* @param thisArg - callback execution context
132132
* @returns output array
133133
*
134134
* @example

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/docs/types/test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import mskfilterMap = require( './index' );
2020

2121
/**
22-
* Unary function.
22+
* Callback function.
2323
*
2424
* @param value - input value
2525
* @returns result
@@ -250,6 +250,7 @@ function clbk( value: number ): number {
250250
const mask = [ 0.0, 0.0, 0.0, 0.0 ];
251251

252252
mskfilterMap.assign(); // $ExpectError
253+
mskfilterMap.assign( x ); // $ExpectError
253254
mskfilterMap.assign( x, mask ); // $ExpectError
254255
mskfilterMap.assign( x, mask, [ 0, 0, 0, 0 ] ); // $ExpectError
255256
mskfilterMap.assign( x, mask, [ 0, 0, 0, 0 ], 1 ); // $ExpectError

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/lib/assign.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
2626
// FUNCTIONS //
2727

2828
/**
29-
* Applies a mask and mapping function to an indexed array and assigns results to elements in an indexed output array.
29+
* Applies a mask and a callback function to an indexed array and assigns results to elements in an indexed output array.
3030
*
3131
* @private
3232
* @param {Collection} x - input array
@@ -35,7 +35,7 @@ var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
3535
* @param {integer} stride - output array stride
3636
* @param {NonNegativeInteger} offset - output array offset
3737
* @param {Function} clbk - function to apply
38-
* @param {*} [thisArg] - function execution context
38+
* @param {*} [thisArg] - callback execution context
3939
* @returns {Collection} output array
4040
*
4141
* @example
@@ -66,7 +66,7 @@ function indexed( x, mask, out, stride, offset, clbk, thisArg ) {
6666
}
6767

6868
/**
69-
* Applies a mask and mapping function to an input accessor array and assigns results to elements in an output accessor array.
69+
* Applies a mask and a callback function to an input accessor array and assigns results to elements in an output accessor array.
7070
*
7171
* @private
7272
* @param {Object} x - input array object
@@ -75,7 +75,7 @@ function indexed( x, mask, out, stride, offset, clbk, thisArg ) {
7575
* @param {integer} stride - output array stride
7676
* @param {NonNegativeInteger} offset - output array offset
7777
* @param {Function} clbk - function to apply
78-
* @param {*} [thisArg] - function execution context
78+
* @param {*} [thisArg] - callback execution context
7979
* @returns {Collection} output array
8080
*
8181
* @example
@@ -130,15 +130,15 @@ function accessors( x, mask, out, stride, offset, clbk, thisArg ) {
130130
// MAIN //
131131

132132
/**
133-
* Applies a mask and mapping function to a provided input array and assigns results to elements in a provided output array.
133+
* Applies a mask and a callback function to a provided input array and assigns results to elements in a provided output array.
134134
*
135135
* @param {Collection} x - input array
136136
* @param {Collection} mask - mask array
137137
* @param {Collection} out - output array
138138
* @param {integer} stride - output array stride
139139
* @param {NonNegativeInteger} offset - output array offset
140140
* @param {Function} clbk - function to apply
141-
* @param {*} [thisArg] - function execution context
141+
* @param {*} [thisArg] - callback execution context
142142
* @returns {Collection} output array
143143
*
144144
* @example

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Apply a mask to a provided input array and return a new array after applying a mapping function.
22+
* Apply a mask and a callback function to a provided input array.
2323
*
2424
* @module @stdlib/array/base/mskfilter-map
2525
*

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/lib/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ var resolveGetter = require( '@stdlib/array/base/resolve-getter' );
2626
// MAIN //
2727

2828
/**
29-
* Apply a mask to a provided input array and returns a new array after applying a mapping function.
29+
* Returns a new array after applying a mask and a callback function to a provided input array.
3030
*
3131
* @param {Collection} x - input array
3232
* @param {Collection} mask - mask array
33-
* @param {Function} clbk - callback to invoke
34-
* @param {*} [thisArg] - execution context
33+
* @param {Function} clbk - callback function
34+
* @param {*} [thisArg] - callback execution context
3535
* @returns {Array} output array
3636
*
3737
* @example

Diff for: lib/node_modules/@stdlib/array/base/mskfilter-map/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/array/base/mskfilter-map",
33
"version": "0.0.0",
4-
"description": "Apply a mask to a provided input array.",
4+
"description": "Apply a mask and a callback function to a provided input array.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

0 commit comments

Comments
 (0)