OpenBookPrices / country-data

Country related data such as ISO codes, currencies etc
MIT License
512 stars 166 forks source link

countries.SK returning Sikkim instead of Slovakia since 0.0.25 #62

Closed silverwind closed 7 years ago

silverwind commented 7 years ago

Since 0.0.25, the 2-digit ISO code SK had changed from Slovakia to Sikkim:

0.0.24

> require('country-data').countries.SK.name
'Slovakia'

0.0.25

> require('country-data').countries.SK.name
'Sikkim'

According to Wikipedia, SK still belongs to Slovakia and SK was actually assigned to Sikkim before 1993. Maybe this change was unintentional?

silverwind commented 7 years ago

Same issue with BY: Previously Byelorussian SSR, should now be Belarus ref. It looks like https://github.com/OpenBookPrices/country-data/commit/b3cbdabd46be67c7f9a2e4083516507df68a6dd5 introduced a few duplicate 2-character codes. @mattvadrise

mattvadrise commented 7 years ago

It's important to have this historical data on previous country code assignments. This means that there are duplicate 2 character codes but they can be distinguished by the the status attribute. "Status": "assigned" indicates the current standard. @silverwind

silverwind commented 7 years ago

Yes, I agree historical data is valuable, but the lookup that happens on countries.<CC> should return the currently assigned country when multiple assignments are found. Right now, I think it defaults to the last defined one.

mattvadrise commented 7 years ago

Ah, yes I see your point. I agree.

evdb commented 7 years ago

Sorry about this bug, thank you for spotting it. v0.0.31 (now on NPM) has fixed it. :)