Skip to content

Commit 90b1abb

Browse files
committed
feat: refactor to use for type checking
1 parent 53ce62b commit 90b1abb

File tree

1 file changed

+4
-10
lines changed
  • lib/node_modules/@stdlib/assert/is-float16array/lib

1 file changed

+4
-10
lines changed

lib/node_modules/@stdlib/assert/is-float16array/lib/main.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,12 @@
1616
* limitations under the License.
1717
*/
1818

19-
/* eslint-disable no-undef, stdlib/jsdoc-doctest */ // TODO: remove once `array/float16` added; consider refactoring similar to `assert/is-complex128array`
20-
2119
'use strict';
2220

2321
// MODULES //
2422

25-
var nativeClass = require( '@stdlib/utils/native-class' );
26-
27-
28-
// VARIABLES //
29-
30-
var hasFloat16Array = ( typeof Float16Array === 'function' ); // eslint-disable-line stdlib/require-globals
23+
var Float16Array = require( '@stdlib/array/float16' );
24+
var constructorName = require( '@stdlib/utils/constructor-name' );
3125

3226

3327
// MAIN //
@@ -50,8 +44,8 @@ var hasFloat16Array = ( typeof Float16Array === 'function' ); // eslint-disable-
5044
*/
5145
function isFloat16Array( value ) {
5246
return (
53-
( hasFloat16Array && value instanceof Float16Array ) || // eslint-disable-line stdlib/require-globals
54-
nativeClass( value ) === '[object Float16Array]'
47+
value instanceof Float16Array ||
48+
constructorName( value ) === 'Float16Array'
5549
);
5650
}
5751

0 commit comments

Comments
 (0)