About stdlib...
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Base array assertion utilities.
npm install @stdlib/array-base-assert
var ns = require( '@stdlib/array-base-assert' );
Assertion utilities.
var o = ns;
// returns {...}
The namespace exports the following:
-
contains( x, value )
: test if an array contains a provided search value. -
hasSameValues( x, y )
: test if two arrays have the same values. -
isAccessorArray( value )
: test if an array-like object supports the accessor (get/set) protocol. -
isBooleanDataType( value )
: test if an input value is a supported array boolean data type. -
isBooleanArray( value )
: test if a value is aBooleanArray
. -
isComplexFloatingPointDataType( value )
: test if an input value is a supported array complex-valued floating-point data type. -
isComplexTypedArray( value )
: test if a value is a complex typed array. -
isComplex128Array( value )
: test if a value is aComplex128Array
. -
isComplex64Array( value )
: test if a value is aComplex64Array
. -
isDataType( value )
: test if an input value is a supported array data type. -
isFloatingPointDataType( value )
: test if an input value is a supported array floating-point data type. -
isIntegerDataType( value )
: test if an input value is a supported array integer data type. -
isMostlySafeDataTypeCast( from, to )
: determine whether an array data type can be safely cast or, for floating-point data types, downcast to another array data type. -
isNumericDataType( value )
: test if an input value is a supported array numeric data type. -
isRealDataType( value )
: test if an input value is a supported array real-valued data type. -
isRealFloatingPointDataType( value )
: test if an input value is a supported array real-valued floating-point data type. -
isSafeDataTypeCast( from, to )
: determine whether an array data type can be safely cast to another array data type. -
isSameKindDataTypeCast( from, to )
: determine whether an array data type can be safely cast to, or is of the same "kind" as, another array data type. -
isSignedIntegerDataType( value )
: test if an input value is a supported array signed integer data type. -
isUnsignedIntegerDataType( value )
: test if an input value is a supported array unsigned integer data type.
var objectKeys = require( '@stdlib/utils-keys' );
var ns = require( '@stdlib/array-base-assert' );
console.log( objectKeys( ns ) );
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.
See LICENSE.
Copyright © 2016-2024. The Stdlib Authors.