-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: mode signature return types #3153
Conversation
Thanks! Your fixes are indeed correct.
I think this type is wrong: in chained function, you can only pass a single Matrix. At first glance I would expect the type to be this: mode(this: MathJsChain<MathCollection>): MathJsChain<MathCollection> And the same for the surrounding functions |
@josdejong I added Please let me know if I am missing something. |
Thanks Rich, looks good 👌 |
Published in |
Reason(s) For Change
mode
with and array of numbers seems to always return array of numbers regardless of how many modes are foundmode
function seems to only ever return an array:mathjs/src/function/statistics/mode.js
Lines 41 to 78 in cee9deb
Changes
mode
signatures return types to be an array of current typesNotes
It is unclear if this type needs to change as well, because it seems like it should return an array on
done
:mathjs/types/index.d.ts
Line 6125 in cee9deb