Skip to content

Commit 6c571bf

Browse files
committed
fix: preserve output array type specificity
--- 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: passed - 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 dcd9428 commit 6c571bf

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/node_modules/@stdlib/math/array/special/abs/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ interface Unary {
5757
* var out = abs( [ -1.0, -2.0, -3.0 ] );
5858
* // returns [ 1.0, 2.0, 3.0 ]
5959
*/
60-
( x: InputArray<number>, options?: Options ): OutputArray<number>;
60+
<T extends InputArray<number>>( x: T, options?: Options ): T;
6161

6262
/**
6363
* Computes the absolute value for each element in an input array and assigns results to a provided output array.
@@ -75,7 +75,7 @@ interface Unary {
7575
* var bool = ( out === y );
7676
* // returns true
7777
*/
78-
assign<V extends OutputArray<number>>( x: InputArray<number>, out: V ): V;
78+
assign<U extends OutputArray<number>>( x: InputArray<number>, out: U ): U;
7979
}
8080

8181
/**

lib/node_modules/@stdlib/math/array/special/abs/docs/types/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import abs = require( './index' );
2828

2929
// The function returns an array...
3030
{
31-
abs( [ 1.0, 2.0, 3.0, 4.0 ] ); // $ExpectType OutputArray<number>
32-
abs( [ 1.0, 2.0, 3.0, 4.0 ], {} ); // $ExpectType OutputArray<number>
31+
abs( [ 1.0, 2.0, 3.0, 4.0 ] ); // $ExpectType number[]
32+
abs( [ 1.0, 2.0, 3.0, 4.0 ], {} ); // $ExpectType number[]
3333
}
3434

3535
// The compiler throws an error if the function is provided a first argument which is not an array...

lib/node_modules/@stdlib/math/array/special/abs/lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* // returns [ 1.0, 2.0, 3.0 ]
3939
*
4040
* var bool = ( out === y );
41+
* // returns true
4142
*/
4243

4344
// MODULES //

0 commit comments

Comments
 (0)