Skip to content
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

Improve TypeScript bindings #20

Closed
mingos777 opened this issue Nov 13, 2018 · 2 comments
Closed

Improve TypeScript bindings #20

mingos777 opened this issue Nov 13, 2018 · 2 comments
Labels

Comments

@mingos777
Copy link

Current TypeScript typings mark the third parametre to the format function as required. However, as shown in the doc, it is clearly optional. It should be marked as optional in the TS typings as well.

In TS, in stead of writing:

format("# ###,#", 19.9, {});

I would like to be able to write:

format("# ###,#", 19.9);
Mottie added a commit that referenced this issue Nov 13, 2018
@Mottie
Copy link
Owner

Mottie commented Nov 13, 2018

Hi @mingos777!

Thanks for reporting this problem! I haven't used typescript, so I'd appreciate it if you would verify everything is working as expected now - https://github.com/Mottie/javascript-number-formatter/blob/master/index.d.ts

Thanks!

@Mottie Mottie added the bug label Nov 13, 2018
@mingos777
Copy link
Author

The TS typings are correct as of version 2.0.7 and I can omit the last argument without raising a compilation error.
Thank you for the quick reaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants