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' );
114114<!-- eslint no-undef: "error" -->
115115
116116``` javascript
117- var indexOf = require ( ' @stdlib/utils/index-of ' );
117+ var contains = require ( ' @stdlib/array/base/assert/contains ' ). factory ;
118118var dtypes = require ( ' @stdlib/array/dtypes' );
119119
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 () );
128121
129122var bool = isdtype ( ' float64' );
130123// returns true
131124
132- bool = isdtype ( ' int16 ' );
125+ bool = isdtype ( ' int8 ' );
133126// returns true
134127
135- bool = isdtype ( ' uint8 ' );
128+ bool = isdtype ( ' uint16 ' );
136129// returns true
137130
138131bool = isdtype ( ' beep' );
Original file line number Diff line number Diff line change 1818
1919'use strict' ;
2020
21- var indexOf = require ( '@stdlib/utils/index-of ' ) ;
21+ var contains = require ( '@stdlib/array/base/assert/contains ' ) . factory ;
2222var dtypes = require ( './../lib' ) ;
2323
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 ( ) ) ;
3225
3326var bool = isdtype ( 'float64' ) ;
3427console . log ( bool ) ;
You can’t perform that action at this time.
0 commit comments