Skip to content

Commit 1cba41b

Browse files
committed
docs: update examples
1 parent 6d50838 commit 1cba41b

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

lib/node_modules/@stdlib/array/dtypes/README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff 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;
118118
var 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

129122
var 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

138131
bool = isdtype( 'beep' );

lib/node_modules/@stdlib/array/dtypes/examples/index.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,10 @@
1818

1919
'use strict';
2020

21-
var indexOf = require( '@stdlib/utils/index-of' );
21+
var contains = require( '@stdlib/array/base/assert/contains' ).factory;
2222
var 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

3326
var bool = isdtype( 'float64' );
3427
console.log( bool );

0 commit comments

Comments
 (0)