-
Notifications
You must be signed in to change notification settings - Fork 143
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
Missing types in currency.Any #446
Comments
What's the value in having a less restrictive type? It's intended for currency.js to try and parse the value and it seems like passing in |
In my project I have a lot of possible If you thing passing |
There is an https://currency.js.org/#erroroninvalid-default-false currency(undefined, { errorOnInvalid: true }); // throws an error I think I have a little better understanding of where you're coming from, it technically is allowed from javascript - so that does seem like something we might want to consider making more loose in typescript. Let me think about what the implications of that change might be. |
The currency.d.ts should be updated to also include
undefined
andnull
oncurrency.Any
, because when passing those values it defaults to0
.This code works fine, but TypeScript complains:
currency(null).add(undefined).value; // 0
The text was updated successfully, but these errors were encountered: