@stdlib/ndarray-base-assert-is-data-type-string
v0.1.1
Published
Test if an input value is a supported built-in ndarray data type string.
Readme
isDataTypeString
Test if an input value is a supported built-in ndarray data type string.
Installation
npm install @stdlib/ndarray-base-assert-is-data-type-stringUsage
var isDataTypeString = require( '@stdlib/ndarray-base-assert-is-data-type-string' );isDataTypeString( value )
Tests if an input value is a supported built-in ndarray data type string.
var bool = isDataTypeString( 'float32' );
// returns true
bool = isDataTypeString( 'int32' );
// returns trueExamples
var isDataTypeString = require( '@stdlib/ndarray-base-assert-is-data-type-string' );
var bool = isDataTypeString( 'binary' );
// returns true
bool = isDataTypeString( 'float32' );
// returns true
bool = isDataTypeString( 'float64' );
// returns true
bool = isDataTypeString( 'generic' );
// returns true
bool = isDataTypeString( 'int16' );
// returns true
bool = isDataTypeString( 'int32' );
// returns true
bool = isDataTypeString( 'int8' );
// returns true
bool = isDataTypeString( 'uint16' );
// returns true
bool = isDataTypeString( 'uint32' );
// returns true
bool = isDataTypeString( 'uint8' );
// returns true
bool = isDataTypeString( 'uint8c' );
// returns true
bool = isDataTypeString( '' );
// returns false
bool = isDataTypeString( 'foo' );
// returns falseNotice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2026. The Stdlib Authors.
