Test if a value is matrix-like.
var isMatrixLike = require( '@stdlib/assert/is-matrix-like' );
Tests if a value is matrix-like.
var Int8Array = require( '@stdlib/array/int8' );
var mat = {
'data': new Int8Array( 10 ),
'shape': [ 5, 2 ],
'offset': 0,
'strides': [ 2, 1 ],
'dtype': 'int8',
'length': 10
};
console.log( isMatrixLike( mat ) );
// returns true
var Int8Array = require( '@stdlib/array/int8' );
var isMatrixLike = require( '@stdlib/assert/is-matrix-like' );
var mat = {
'data': new Int8Array( 10 ),
'shape': [ 5, 2 ],
'offset': 0,
'strides': [ 2, 1 ],
'dtype': 'int8',
'length': 10
};
console.log( isMatrixLike( mat ) );
// returns true
console.log( isMatrixLike( [] ) );
// returns false
console.log( isMatrixLike( {} ) );
// returns false
console.log( isMatrixLike( null ) );
// returns false