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

TypeScript typings too optimistic #258

Closed
osdiab opened this issue Sep 28, 2021 · 3 comments
Closed

TypeScript typings too optimistic #258

osdiab opened this issue Sep 28, 2021 · 3 comments

Comments

@osdiab
Copy link

osdiab commented Sep 28, 2021

Some of the function types say that they'll return a string, but in fact often return undefined.

For example, if you use getAlpha2Code("Laos", "en"), then in fact you get undefined, not the stated string return type, because you were supposed to type Lao People's Democratic Republic (the fact that Laos doesn't match is a separate issue).

I'm willing to make a PR that makes these types more accurate to the true behavior of the library, but want to make sure that maintainers are OK with that change first.

@michaelwittig
Copy link
Owner

Yes. I would love to see them improved! #198 was trying that as well. You might just comment on that PR.

@michaelwittig
Copy link
Owner

duplicate of #184 ?

@osdiab
Copy link
Author

osdiab commented Sep 29, 2021

ah yeah duplicate - I'll push a pr to fix it! That one looks stale and I can do even better :)

@osdiab osdiab closed this as completed Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants