(value, index)
| 87 | * @throws DimensionError |
| 88 | */ |
| 89 | export function validateIndexSourceSize (value, index) { |
| 90 | const valueSize = value.isMatrix ? value._size : arraySize(value) |
| 91 | const sourceSize = index._sourceSize |
| 92 | // checks if the source size is not null and matches the valueSize |
| 93 | sourceSize.forEach((sourceDim, i) => { |
| 94 | if (sourceDim !== null && sourceDim !== valueSize[i]) { throw new DimensionError(sourceDim, valueSize[i]) } |
| 95 | }) |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Test whether index is an integer number with index >= 0 and index < length |
no test coverage detected
searching dependent graphs…