Skip to content

Commit ba4b452

Browse files
committed
fix: correct test.ts
--- 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: na - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 08534e6 commit ba4b452

File tree

1 file changed

+9
-3
lines changed
  • lib/node_modules/@stdlib/stats/base/nanrange-by/docs/types

1 file changed

+9
-3
lines changed

lib/node_modules/@stdlib/stats/base/nanrange-by/docs/types/test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2020 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
import nanrangeBy = require( './index' );
2019
import AccessorArray = require( '@stdlib/array/base/accessor' );
20+
import nanrangeBy = require( './index' );
2121

2222
const accessor = (): number => {
2323
return 5.0;
@@ -30,7 +30,10 @@ const accessor = (): number => {
3030
{
3131
const x = new Float64Array( 10 );
3232

33+
nanrangeBy( x.length, x, 1, accessor ); // $ExpectType number
3334
nanrangeBy( x.length, new AccessorArray( x ), 1, accessor ); // $ExpectType number
35+
36+
nanrangeBy( x.length, x, 1, accessor, {} ); // $ExpectType number
3437
nanrangeBy( x.length, new AccessorArray( x ), 1, accessor, {} ); // $ExpectType number
3538
}
3639

@@ -71,7 +74,7 @@ const accessor = (): number => {
7174
nanrangeBy( x.length, x, undefined, accessor ); // $ExpectError
7275
nanrangeBy( x.length, x, [], accessor ); // $ExpectError
7376
nanrangeBy( x.length, x, {}, accessor ); // $ExpectError
74-
nanrangeBy( x.length, x, ( x: number, accessor ): number => x, accessor ); // $ExpectError
77+
nanrangeBy( x.length, x, ( x: number ): number => x, accessor ); // $ExpectError
7578
}
7679

7780
// The compiler throws an error if the function is provided a fourth argument which is not a function...
@@ -102,7 +105,10 @@ const accessor = (): number => {
102105
{
103106
const x = new Float64Array( 10 );
104107

108+
nanrangeBy.ndarray( x.length, x, 1, 0, accessor ); // $ExpectType number
105109
nanrangeBy.ndarray( x.length, new AccessorArray( x ), 1, 0, accessor ); // $ExpectType number
110+
111+
nanrangeBy.ndarray( x.length, x, 1, 0, accessor, {} ); // $ExpectType number
106112
nanrangeBy.ndarray( x.length, new AccessorArray( x ), 1, 0, accessor, {} ); // $ExpectType number
107113
}
108114

0 commit comments

Comments
 (0)