0.3.0 • Published 11 months ago
@stdlib/array-base-assert v0.3.0
assert
Base array assertion utilities.
Installation
npm install @stdlib/array-base-assert
Usage
var ns = require( '@stdlib/array-base-assert' );
ns
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.
Examples
var objectKeys = require( '@stdlib/utils-keys' );
var ns = require( '@stdlib/array-base-assert' );
console.log( objectKeys( ns ) );
Notice
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-2024. The Stdlib Authors.