mathjs
mathjs copied to clipboard
How to access `Unit.isValidAlpha`?
Using TypeScript:
import math from 'mathjs';`
// @ts-expect-error
math.Unit.isValidAlpha = () => {
return true;
};
Throws Cannot read property \'Unit\' of undefined.
Thanks for reporting Antoni.
It may be that this is simply an other example of the TypeScript definitions not being up to date, see also #1539, #2076.
Help getting the TypeScript definitions up to date would be very welcome!
@josdejong Thanks for a quick reply! The TypeScript definition is outdated, although I forgot to mention that this error occurs after adding the @ts-expect-error or @ts-ignore declaration (edited the issue description for clarity). So I think something is wrong with the export...