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

Reorganize country/format definitions #5

Open
istanishev opened this issue Mar 15, 2016 · 3 comments
Open

Reorganize country/format definitions #5

istanishev opened this issue Mar 15, 2016 · 3 comments

Comments

@istanishev
Copy link
Collaborator

  • Use "postal-codes-alpha2.json" as default configuration file where everything is defined.
  • Fix the numeric3 codes in "postal-codes-alpha2.json" (they should be 3-digits long)
  • Generate "postal-codes-alpha3.json" & "postal-codes-numeric3.json" based on "postal-codes-alpha2.json"
  • Retire the json configurations inside mappings folder
@drzraf
Copy link

drzraf commented Jun 27, 2019

I'd advise that a refresh happens from http://download.geonames.org/export/dump/countryInfo.txt
For example "AR" regexp is wrong in this repository but correct in geonames.

@tomhooijenga
Copy link
Contributor

Is this still wanted? I'd be able to take a shot at this. This package is great, but the mappings are due for some refactoring. There are now three locations to add formats. My last PR showed that this doesn't always go right.

Other things to take in consideration

  • Fix the returns: either
    • return strings from an enum
    • return true/false and throw for exceptional situations
  • split test data from formats so it isn't loaded in production
  • typescript maybe?

Also pinging @ozankaya because they seem to be in charge now

@ozankaya
Copy link
Contributor

Yes, this refactoring is still required. Your list above looks good to me. Maybe we can skip TypeScript for now. We have declarations file for TypeScript support.

@tomhooijenga tomhooijenga mentioned this issue Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants