File tree Expand file tree Collapse file tree 2 files changed +6
-20
lines changed
lib/node_modules/@stdlib/array/dtypes Expand file tree Collapse file tree 2 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -114,25 +114,18 @@ var out = dtypes( 'floating_point_and_generic' );
114
114
<!-- eslint no-undef: "error" -->
115
115
116
116
``` javascript
117
- var indexOf = require ( ' @stdlib/utils/index-of ' );
117
+ var contains = require ( ' @stdlib/array/base/assert/contains ' ). factory ;
118
118
var dtypes = require ( ' @stdlib/array/dtypes' );
119
119
120
- var DTYPES = dtypes ();
121
-
122
- function isdtype ( str ) {
123
- if ( indexOf ( DTYPES , str ) === - 1 ) {
124
- return false ;
125
- }
126
- return true ;
127
- }
120
+ var isdtype = contains ( dtypes () );
128
121
129
122
var bool = isdtype ( ' float64' );
130
123
// returns true
131
124
132
- bool = isdtype ( ' int16 ' );
125
+ bool = isdtype ( ' int8 ' );
133
126
// returns true
134
127
135
- bool = isdtype ( ' uint8 ' );
128
+ bool = isdtype ( ' uint16 ' );
136
129
// returns true
137
130
138
131
bool = isdtype ( ' beep' );
Original file line number Diff line number Diff line change 18
18
19
19
'use strict' ;
20
20
21
- var indexOf = require ( '@stdlib/utils/index-of ' ) ;
21
+ var contains = require ( '@stdlib/array/base/assert/contains ' ) . factory ;
22
22
var dtypes = require ( './../lib' ) ;
23
23
24
- var DTYPES = dtypes ( ) ;
25
-
26
- function isdtype ( str ) {
27
- if ( indexOf ( DTYPES , str ) === - 1 ) {
28
- return false ;
29
- }
30
- return true ;
31
- }
24
+ var isdtype = contains ( dtypes ( ) ) ;
32
25
33
26
var bool = isdtype ( 'float64' ) ;
34
27
console . log ( bool ) ;
You can’t perform that action at this time.
0 commit comments