mathjs icon indicating copy to clipboard operation
mathjs copied to clipboard

MathArray typescript type definition only handles 1D and 2D arrays

Open Amolition opened this issue 2 years ago • 3 comments

Description The MathArray typescript type cannot accept any N-dimensional arrays (it is limited to 1D or 2D arrays). This is despite many/all functions where the MathArray type is used being capable of handling and returning arbitrary n-dimensional arrays

To Reproduce Use a function from mathjs which accepts a MathCollection or MathArray parameter in a typescript file. Try to apply the function to a 3D or greater dimensional array. Typescript linters will claim there is an incorrect type but the function should run normally and output the result as expected.

Amolition avatar Dec 06 '23 11:12 Amolition

Good point to see if we can improve on this 👍

josdejong avatar Dec 08 '23 07:12 josdejong

@josdejong what exactly need to improve herr, which functions doesn't take multi dimensional array?

rakheesingh avatar Dec 09 '23 19:12 rakheesingh

See #3099

josdejong avatar Dec 09 '23 21:12 josdejong