Test if a value is an ndarray descriptor.
var isndarrayDescriptor = require( '@stdlib/assert/is-ndarray-descriptor' );Tests if a value is an ndarray descriptor.
var zeros = require( '@stdlib/ndarray/zeros' );
var bool = isndarrayDescriptor( zeros( [ 2, 2 ] ) );
// returns trueA value is an ndarray descriptor if a value is an object with the following properties:
- dtype: an ndarray's underlying data type.
- data: array-like object pointing to an underlying data buffer.
- shape: array-like object containing dimensions.
- strides: array-like object containing stride lengths.
- offset: number specifying the index offset.
- order: string describing the memory layout.
var zeros = require( '@stdlib/ndarray/zeros' );
var isndarrayDescriptor = require( '@stdlib/assert/is-ndarray-descriptor' );
var bool = isndarrayDescriptor( zeros( [ 2, 2 ] ) );
// returns true
bool = isndarrayDescriptor( [ 1, 2, 3, 4 ] );
// returns false
bool = isndarrayDescriptor( {} );
// returns false
bool = isndarrayDescriptor( null );
// returns false