We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent def6edc commit a83bb3dCopy full SHA for a83bb3d
lib/node_modules/@stdlib/ndarray/base/dtype-enum2str/lib/main.js
@@ -20,6 +20,7 @@
20
21
// MODULES //
22
23
+var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
24
var objectInverse = require( '@stdlib/utils/object-inverse' );
25
var enumeration = require( '@stdlib/ndarray/dtypes' ).enum;
26
@@ -50,7 +51,7 @@ var hash = objectInverse( enumeration(), {
50
51
*/
52
function enum2str( dtype ) {
53
var v = hash[ dtype ];
- return ( typeof v === 'string' ) ? v : null; // note: we include this guard to prevent walking the prototype chain
54
+ return ( isString( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain
55
}
56
57
0 commit comments