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

Unable to get a list of valid country codes #320

Open
kneepdee opened this issue Mar 6, 2020 · 3 comments · May be fixed by #353
Open

Unable to get a list of valid country codes #320

kneepdee opened this issue Mar 6, 2020 · 3 comments · May be fixed by #353

Comments

@kneepdee
Copy link

kneepdee commented Mar 6, 2020

Expected Behavior

It would be useful to have a method that returns a list of valid / supported countries data similar to intl-tel-input's getCountryData method

Current Behavior

Currently there seems to be no way to get the supported countries other than extract them from source manually

const defaultCountriesData = [
. This is a source of code duplication and might lead to maintainability issues.

Possible Solution

The API would expose a method getCountryData that returns a list of all countries similar in shape to defaultCountriesData.

@mcataford
Copy link
Collaborator

Hi @kneepdee! That's a great suggestion! If you are interested in taking that on, feel free to fork and to open a PR! Otherwise, I'll try to get to it over the weekend.

@kneepdee
Copy link
Author

kneepdee commented Mar 9, 2020

Hi @mcataford ! Thanks for the quick reply. If you haven't already, I would like to tackle this issue. Probably will take some time for me to open a PR but but looking at the code, it doesn't seem to be overly complicated.

@mcataford
Copy link
Collaborator

mcataford commented Mar 9, 2020

That's great! In this case, it's all yours! 🎉

Don't hesitate to ping me if you want a comments about ongoing work on this, I'll look forward to seeing a PR up for it!

Once you do get a PR up, mention this issue in the description, that way it'll be easy to track. 🚀

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

Successfully merging a pull request may close this issue.

2 participants