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

TypeError: Cannot read property 'toUpperCase' of undefined at Object.country #24

Open
braco opened this issue May 25, 2018 · 1 comment

Comments

@braco
Copy link

braco commented May 25, 2018

iso3166.country('dam')

TypeError: Cannot read property 'toUpperCase' of undefined at Object.country (node_modules/iso-3166-2/iso3166.min.js:9:17735)

@mapolonio
Copy link

Hi, I'm having this same error whenever I use the country function for 3 character strings. When a value is provided that does not match with any alpha-3 country code an error is thrown with message Cannot read property 'toUpperCase' of undefined. This is due to this:
https://github.com/olahol/iso-3166-2.js/blob/master/functions.js#L89
and then
https://github.com/olahol/iso-3166-2.js/blob/master/functions.js#L103

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