File tree Expand file tree Collapse file tree 4 files changed +9
-12
lines changed
lib/node_modules/@stdlib/ndarray/dtypes Expand file tree Collapse file tree 4 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,6 @@ var indexOf = require( '@stdlib/utils/index-of' );
109109var dtypes = require ( ' @stdlib/ndarray/dtypes' );
110110
111111var DTYPES = dtypes ();
112- var bool;
113112
114113function isdtype ( str ) {
115114 if ( indexOf ( DTYPES , str ) === - 1 ) {
@@ -118,7 +117,7 @@ function isdtype( str ) {
118117 return true ;
119118}
120119
121- bool = isdtype ( ' float64' );
120+ var bool = isdtype ( ' float64' );
122121// returns true
123122
124123bool = isdtype ( ' int16' );
Original file line number Diff line number Diff line change 1818
1919// TypeScript Version: 4.1
2020
21- /**
22- * Data type kind.
23- */
24- type Kind = 'all' | 'numeric' | 'real' | 'floating_point' | 'real_floating_point' | 'complex_floating_point' | 'integer' | 'signed_integer' | 'unsigned_integer' ;
21+ /// <reference types="@stdlib/types"/>
22+
23+ import { DataType , DataTypeKind } from '@stdlib/types/ndarray' ;
2524
2625/**
2726* Returns a list of ndarray data types.
@@ -55,7 +54,7 @@ type Kind = 'all' | 'numeric' | 'real' | 'floating_point' | 'real_floating_point
5554* var list = dtypes( 'floating_point' );
5655* // returns [...]
5756*/
58- declare function dtypes ( kind ?: Kind ) : Array < string > ;
57+ declare function dtypes ( kind ?: DataTypeKind ) : Array < DataType > ;
5958
6059
6160// EXPORTS //
Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ import dtypes = require( './index' );
2121
2222// TESTS //
2323
24- // The function returns an array of strings ...
24+ // The function returns an array of data types ...
2525{
26- dtypes ( ) ; // $ExpectType string []
27- dtypes ( 'floating_point' ) ; // $ExpectType string []
26+ dtypes ( ) ; // $ExpectType DataType []
27+ dtypes ( 'floating_point' ) ; // $ExpectType DataType []
2828}
2929
3030// The compiler throws an error if the function is provided an unsupported number of arguments...
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ var indexOf = require( '@stdlib/utils/index-of' );
2222var dtypes = require ( './../lib' ) ;
2323
2424var DTYPES = dtypes ( ) ;
25- var bool ;
2625
2726function isdtype ( str ) {
2827 if ( indexOf ( DTYPES , str ) === - 1 ) {
@@ -31,7 +30,7 @@ function isdtype( str ) {
3130 return true ;
3231}
3332
34- bool = isdtype ( 'float64' ) ;
33+ var bool = isdtype ( 'float64' ) ;
3534console . log ( bool ) ;
3635// => true
3736
You can’t perform that action at this time.
0 commit comments