(m)
| 12 | * @returns {Shape} |
| 13 | */ |
| 14 | export const shape = (m) => { |
| 15 | const shapes = []; |
| 16 | let dimension = m; |
| 17 | while (dimension && Array.isArray(dimension)) { |
| 18 | shapes.push(dimension.length); |
| 19 | dimension = (dimension.length && [...dimension][0]) || null; |
| 20 | } |
| 21 | return shapes; |
| 22 | }; |
| 23 | |
| 24 | /** |
| 25 | * Checks if matrix has a correct type. |
no test coverage detected