Skip to content

Commit 8b45b53

Browse files
committed
fix: ensure type parameter can be inferred
--- 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 239d633 commit 8b45b53

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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
@@ -111,7 +111,7 @@ type Predicate<T, U, ThisArg> = Nullary<ThisArg> | Unary<T, ThisArg> | Binary<T,
111111
* var out = find( [ x, sv ], predicate );
112112
* // returns 2.0
113113
*/
114-
declare function find<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = unknown, ThisArg = unknown >( arrays: [ U, typedndarray<V> ], predicate: Predicate<T, U, ThisArg>, thisArg?: ThisParameterType<Predicate<T, U, ThisArg>> ): T | V;
114+
declare function find<T = unknown, U extends typedndarray<T> = typedndarray<T>, V = unknown, ThisArg = unknown >( arrays: [ typedndarray<T>, typedndarray<V> ], predicate: Predicate<T, U, ThisArg>, thisArg?: ThisParameterType<Predicate<T, U, ThisArg>> ): T | V;
115115

116116

117117
// EXPORTS //

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ function clbk( v: any ): boolean {
3939

4040
// The function returns a number...
4141
{
42-
const x = zeros( [ 2, 2 ] );
42+
const x = zeros( [ 2, 2 ], {
43+
'dtype': 'float64'
44+
});
4345
const sv = scalar2ndarray( NaN, {
4446
'dtype': 'float64'
4547
});
@@ -71,7 +73,9 @@ function clbk( v: any ): boolean {
7173

7274
// The compiler throws an error if the function is provided a second argument which is not a callback function...
7375
{
74-
const x = zeros( [ 2, 2 ] );
76+
const x = zeros( [ 2, 2 ], {
77+
'dtype': 'float64'
78+
});
7579
const sv = scalar2ndarray( NaN, {
7680
'dtype': 'float64'
7781
});
@@ -97,7 +101,9 @@ function clbk( v: any ): boolean {
97101

98102
// The compiler throws an error if the function is provided an unsupported number of arguments...
99103
{
100-
const x = zeros( [ 2, 2 ] );
104+
const x = zeros( [ 2, 2 ], {
105+
'dtype': 'float64'
106+
});
101107
const sv = scalar2ndarray( NaN, {
102108
'dtype': 'float64'
103109
});

0 commit comments

Comments
 (0)