Skip to content

Commit 2ca2802

Browse files
committed
chore: make consistent
--- 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: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - 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: passed - task: lint_license_headers status: passed ---
1 parent d650d02 commit 2ca2802

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ type Predicate<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
7373
* @param arrays - array-like object containing one input ndarray and a zero-dimensional sentinel value ndarray
7474
* @param predicate - predicate function
7575
* @param thisArg - predicate function execution context
76-
* @returns boolean indicating whether all elements pass a test
76+
* @returns result
7777
*
7878
* @example
7979
* var Float64Array = require( '@stdlib/array/float64' );
@@ -108,7 +108,7 @@ type Predicate<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
108108
* var out = find( [ x, sv ], predicate );
109109
* // returns 2.0
110110
*/
111-
declare function find<T = unknown, U = unknown, V = unknown>( arrays: ArrayLike<typedndarray<T>>, predicate: Predicate<T, U>, thisArg?: ThisParameterType<Predicate<T, U>> ): V;
111+
declare function find<T = unknown, U = unknown >( arrays: ArrayLike<typedndarray<T>>, predicate: Predicate<T, U>, thisArg?: ThisParameterType<Predicate<T, U>> ): T;
112112

113113

114114
// EXPORTS //

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/// <reference types="@stdlib/types"/>
2020

2121
import zeros = require( '@stdlib/ndarray/zeros' );
22+
import scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
2223
import find = require( './index' );
2324

2425
/**
@@ -34,14 +35,16 @@ function clbk( v: any ): boolean {
3435

3536
// TESTS //
3637

37-
// The function returns a float64...
38+
// The function returns a number...
3839
{
3940
const x = zeros( [ 2, 2 ] );
40-
const v = zeros( [] );
41-
const arrays = [ x, v ];
41+
const sv = scalar2ndarray( -1.0, {
42+
'dtype': 'float64'
43+
} );
44+
const arrays = [ x, sv ];
4245

43-
find( arrays, clbk ); // $ExpectType float64
44-
find( arrays, clbk, {} ); // $ExpectType float64
46+
find( arrays, clbk ); // $ExpectType number
47+
find( arrays, clbk, {} ); // $ExpectType number
4548
}
4649

4750
// The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarray-like objects...
@@ -68,8 +71,10 @@ function clbk( v: any ): boolean {
6871
// The compiler throws an error if the function is provided a second argument which is not a callback function...
6972
{
7073
const x = zeros( [ 2, 2 ] );
71-
const v = zeros( [] );
72-
const arrays = [ x, v ];
74+
const sv = scalar2ndarray( -1.0, {
75+
'dtype': 'float64'
76+
} );
77+
const arrays = [ x, sv ];
7378

7479
find( arrays, '10' ); // $ExpectError
7580
find( arrays, 5 ); // $ExpectError
@@ -93,8 +98,10 @@ function clbk( v: any ): boolean {
9398
// The compiler throws an error if the function is provided an unsupported number of arguments...
9499
{
95100
const x = zeros( [ 2, 2 ] );
96-
const v = zeros( [] );
97-
const arrays = [ x, v ];
101+
const sv = scalar2ndarray( -1.0, {
102+
'dtype': 'float64'
103+
} );
104+
const arrays = [ x, sv ];
98105

99106
find(); // $ExpectError
100107
find( arrays ); // $ExpectError

0 commit comments

Comments
 (0)