Skip to content

Commit 6c4416b

Browse files
committed
refactor: apply suggestions from code review
--- 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: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - 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: na - task: lint_license_headers status: passed ---
1 parent 5dc4859 commit 6c4416b

File tree

19 files changed

+27
-25
lines changed

19 files changed

+27
-25
lines changed

lib/node_modules/@stdlib/ndarray/base/find/docs/repl.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
{{alias}}( arrays, predicate[, thisArg] )
3-
Returns the first element in an ndarray which pass a test implemented by a
3+
Returns the first element in an ndarray which passes a test implemented by a
44
predicate function.
55

66
A provided "ndarray" should be an `object` with the following properties:
@@ -23,7 +23,9 @@
2323
----------
2424
arrays: ArrayLikeObject<ndarray>
2525
Array-like object containing an input ndarray and a zero-dimensional
26-
array containing the sentinel value.
26+
ndarray containing a sentinel value which should be returned when no
27+
element in an input ndarray passes a test implemented by the predicate
28+
function.
2729

2830
predicate: Function
2931
Predicate function.
@@ -38,6 +40,9 @@
3840

3941
Examples
4042
--------
43+
// Define a callback...
44+
> function clbk( v ) { return v % 2.0 === 0.0; };
45+
4146
// Define ndarray data and meta data...
4247
> var xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0, 4.0 ] );
4348
> var dt = 'float64';
@@ -46,11 +51,8 @@
4651
> var ox = 0;
4752
> var ord = 'row-major';
4853

49-
// Define a callback...
50-
> function clbk( v ) { return v % 2.0 === 0.0; };
51-
52-
> var sv = {{alias:@stdlib/ndarray/from-scalar}}( NaN, { 'dtype': 'float64' } );
5354
> var x = {{alias:@stdlib/ndarray/ctor}}( dt, xbuf, sh, sx, ox, ord );
55+
> var sv = {{alias:@stdlib/ndarray/from-scalar}}( NaN, { 'dtype': 'float64' } );
5456
> {{alias}}( [ x, sv ], clbk )
5557
2.0
5658

lib/node_modules/@stdlib/ndarray/base/find/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ type Ternary<T, U> = ( this: U, value: T, indices: Array<number>, arr: typedndar
6868
type Predicate<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
6969

7070
/**
71-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
71+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
7272
*
7373
* @param arrays - array-like object containing one input ndarray and a zero-dimensional sentinel value ndarray
7474
* @param predicate - predicate function

lib/node_modules/@stdlib/ndarray/base/find/examples/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var Float64Array = require( '@stdlib/array/float64' );
2525
var ndarray2array = require( '@stdlib/ndarray/base/to-array' );
2626
var find = require( './../lib' );
2727

28-
function clbk( value ) {
28+
function isEven( value ) {
2929
return value % 2.0 === 0.0;
3030
}
3131

@@ -51,5 +51,5 @@ var sv = {
5151
};
5252
console.log( 'Sentinel Value: %d', sv.data[ 0 ] );
5353

54-
var out = find( [ x, sv ], clbk );
54+
var out = find( [ x, sv ], isEven );
5555
console.log( out );

lib/node_modules/@stdlib/ndarray/base/find/lib/0d.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MAIN //
2222

2323
/**
24-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
24+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
2525
*
2626
* @private
2727
* @param {Object} x - object containing ndarray meta data

lib/node_modules/@stdlib/ndarray/base/find/lib/0d_accessors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MAIN //
2222

2323
/**
24-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
24+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
2525
*
2626
* @private
2727
* @param {Object} x - object containing ndarray meta data

lib/node_modules/@stdlib/ndarray/base/find/lib/1d.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MAIN //
2222

2323
/**
24-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
24+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
2525
*
2626
* @private
2727
* @param {Object} x - object containing ndarray meta data

lib/node_modules/@stdlib/ndarray/base/find/lib/1d_accessors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MAIN //
2222

2323
/**
24-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
24+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
2525
*
2626
* @private
2727
* @param {Object} x - object containing ndarray meta data

lib/node_modules/@stdlib/ndarray/base/find/lib/2d.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
2929
// MAIN //
3030

3131
/**
32-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
32+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
3333
*
3434
* @private
3535
* @param {Object} x - object containing ndarray meta data

lib/node_modules/@stdlib/ndarray/base/find/lib/2d_accessors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var take = require( '@stdlib/array/base/take-indexed' );
2929
// MAIN //
3030

3131
/**
32-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
32+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
3333
*
3434
* @private
3535
* @param {Object} x - object containing ndarray meta data

lib/node_modules/@stdlib/ndarray/base/find/lib/2d_blocked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var reverse = require( '@stdlib/array/base/reverse' );
2929
// MAIN //
3030

3131
/**
32-
* Returns the first element in an ndarray which pass a test implemented by a predicate function.
32+
* Returns the first element in an ndarray which passes a test implemented by a predicate function.
3333
*
3434
* @private
3535
* @param {Object} x - object containing ndarray meta data

0 commit comments

Comments
 (0)