Skip to content

Commit 519b1d3

Browse files
committed
fix: improve 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: 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 cc35d03 commit 519b1d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/node_modules/@stdlib/ndarray/from-scalar/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// <reference types="@stdlib/types"/>
2222

2323
import { ComplexLike } from '@stdlib/types/complex';
24-
import { ndarray, float64ndarray, float32ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, complex128ndarray, complex64ndarray, boolndarray, DataType, Order } from '@stdlib/types/ndarray';
24+
import { float64ndarray, float32ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, complex128ndarray, complex64ndarray, genericndarray, boolndarray, DataType, Order } from '@stdlib/types/ndarray';
2525

2626
/**
2727
* Interface defining common options.
@@ -520,7 +520,7 @@ declare function scalar2ndarray( value: number, options: Uint8cOptions ): uint8c
520520
* var v = x.get();
521521
* // returns 1.0
522522
*/
523-
declare function scalar2ndarray( value: any, options?: Options ): ndarray;
523+
declare function scalar2ndarray<T = any>( value: T, options?: Options ): genericndarray<T>;
524524

525525

526526
// EXPORTS //

lib/node_modules/@stdlib/ndarray/from-scalar/docs/types/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import scalar2ndarray = require( './index' );
2323

2424
// The function returns an ndarray...
2525
{
26-
scalar2ndarray( 1.0 ); // $ExpectType ndarray
26+
scalar2ndarray( 1.0 ); // $ExpectType genericndarray<number>
2727

2828
scalar2ndarray( 1.0, { 'dtype': 'float64' } ); // $ExpectType float64ndarray
2929
scalar2ndarray( 1.0, { 'dtype': 'float32' } ); // $ExpectType float32ndarray
@@ -37,7 +37,7 @@ import scalar2ndarray = require( './index' );
3737
scalar2ndarray( 1.0, { 'dtype': 'uint16' } ); // $ExpectType uint16ndarray
3838
scalar2ndarray( 1.0, { 'dtype': 'uint8' } ); // $ExpectType uint8ndarray
3939
scalar2ndarray( 1.0, { 'dtype': 'uint8c' } ); // $ExpectType uint8cndarray
40-
scalar2ndarray( 1.0, { 'dtype': 'generic' } ); // $ExpectType ndarray
40+
scalar2ndarray( 1.0, { 'dtype': 'generic' } ); // $ExpectType genericndarray<number>
4141
}
4242

4343
// The compiler throws an error if the function is provided a second argument which is not an options object...

0 commit comments

Comments
 (0)