MCPcopy Index your code
hub / github.com/josdejong/mathjs / validate

Function validate

src/utils/array.js:70–81  ·  view source on GitHub ↗
(array, size)

Source from the content-addressed store, hash-verified

68 * @throws DimensionError
69 */
70export function validate (array, size) {
71 const isScalar = (size.length === 0)
72 if (isScalar) {
73 // scalar
74 if (Array.isArray(array)) {
75 throw new DimensionError(array.length, 0)
76 }
77 } else {
78 // array
79 _validate(array, size, 0)
80 }
81}
82
83/**
84 * Validate whether the source of the index matches the size of the Array

Callers 2

array.test.jsFile · 0.90
DenseMatrixFunction · 0.90

Calls 1

_validateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…