(array, size)
| 68 | * @throws DimensionError |
| 69 | */ |
| 70 | export 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 |
no test coverage detected
searching dependent graphs…