File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
lib/node_modules/@stdlib/ndarray/base/assert/is-boolean-index-data-type Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ var contains = require( '@stdlib/array/base/assert/contains' ).factory;
24
24
var dtypes = require ( '@stdlib/ndarray/dtypes' ) ;
25
25
26
26
27
+ // VARIABLES //
28
+
29
+ var isDataType = contains ( dtypes ( 'boolean_index' ) ) ;
30
+
31
+
27
32
// MAIN //
28
33
29
34
/**
@@ -71,7 +76,9 @@ var dtypes = require( '@stdlib/ndarray/dtypes' );
71
76
* bool = isBooleanIndexDataType( 'foo' );
72
77
* // returns false
73
78
*/
74
- var isBooleanIndexDataType = contains ( dtypes ( 'boolean_index' ) ) ;
79
+ function isBooleanIndexDataType ( v ) {
80
+ return isDataType ( String ( v ) ) ;
81
+ }
75
82
76
83
77
84
// EXPORTS //
Original file line number Diff line number Diff line change 21
21
// MODULES //
22
22
23
23
var tape = require ( 'tape' ) ;
24
+ var DataType = require ( '@stdlib/ndarray/dtype-ctor' ) ;
24
25
var isBooleanIndexDataType = require ( './../lib' ) ;
25
26
26
27
@@ -38,7 +39,8 @@ tape( 'the function returns `true` if provided a supported ndarray boolean index
38
39
var i ;
39
40
40
41
values = [
41
- 'bool'
42
+ 'bool' ,
43
+ new DataType ( 'bool' )
42
44
] ;
43
45
for ( i = 0 ; i < values . length ; i ++ ) {
44
46
bool = isBooleanIndexDataType ( values [ i ] ) ;
@@ -68,6 +70,8 @@ tape( 'the function returns `false` if not provided a supported ndarray boolean
68
70
'uint8c' ,
69
71
'generic' ,
70
72
73
+ new DataType ( 'generic' ) ,
74
+
71
75
// Unsupported dtypes:
72
76
'float' ,
73
77
'int' ,
You can’t perform that action at this time.
0 commit comments