A suite to track Project Diva score statistics and ratings / D4DJ event data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
projectdivar/server/node_modules/validate.io-ndarray-like/lib/index.js

25 lines
562 B

'use strict';
/**
* FUNCTION: ndarrayLike( value )
* Validates if a value is ndarray-like.
*
* @param {*} value - value to be validated
* @returns {Boolean} boolean indicating if a value is ndarray-like
*/
function ndarrayLike( v ) {
return v !== null &&
typeof v === 'object' &&
typeof v.data === 'object' &&
typeof v.shape === 'object' &&
typeof v.strides === 'object' &&
typeof v.offset === 'number' &&
typeof v.dtype === 'string' &&
typeof v.length === 'number';
} // end FUNCTION ndarrayLike()
// EXPORTS //
module.exports = ndarrayLike;