@plotly/regl
Version:
regl is a fast functional WebGL framework.
14 lines (12 loc) • 365 B
JavaScript
var isTypedArray = require('./is-typed-array')
module.exports = function isNDArrayLike (obj) {
return (
!!obj &&
typeof obj === 'object' &&
Array.isArray(obj.shape) &&
Array.isArray(obj.stride) &&
typeof obj.offset === 'number' &&
obj.shape.length === obj.stride.length &&
(Array.isArray(obj.data) ||
isTypedArray(obj.data)))
}