Skip to content

Commit b4606f8

Browse files
committed
style: replace isString with inline typeof check in ml/base/kmeans/algorithm-enum2str
Match the established enum2str pattern used by `blas/base/transpose-operation-enum2str` and the other BLAS enum2str packages: drop the `@stdlib/assert/is-string` import and use an inline `typeof v === 'string'` guard instead.
1 parent e859fb4 commit b4606f8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • lib/node_modules/@stdlib/ml/base/kmeans/algorithm-enum2str/lib

lib/node_modules/@stdlib/ml/base/kmeans/algorithm-enum2str/lib/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
2423
var objectInverse = require( '@stdlib/object/inverse' );
2524
var enumeration = require( '@stdlib/ml/base/kmeans/algorithms' ).enum;
2625

@@ -51,7 +50,7 @@ var hash = objectInverse( enumeration(), {
5150
*/
5251
function enum2str( value ) {
5352
var v = hash[ value ];
54-
return ( isString( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain
53+
return ( typeof v === 'string' ) ? v : null; // note: we include this guard to prevent walking the prototype chain
5554
}
5655

5756

0 commit comments

Comments
 (0)