country-data
Advanced tools
Comparing version 0.0.30 to 0.0.31
# Changes | ||
## v0.0.31 | ||
* fixed deleted countries appearing in countries[alpha2] instead of the current active country - thanks @silverwind | ||
## v0.0.30 | ||
* Added emoji flags for countries - thanks @livedo | ||
## v0.0.29 | ||
@@ -4,0 +12,0 @@ |
12
index.js
@@ -21,4 +21,12 @@ 'use strict'; | ||
_.each(countriesAll, function (country) { | ||
exports.countries[country.alpha2] = country; | ||
exports.countries[country.alpha3] = country; | ||
// prefer assigned country codes over inactive ones | ||
var exportedAlpha2 = exports.countries[country.alpha2]; | ||
if (!exportedAlpha2 || exportedAlpha2.status === 'deleted') { | ||
exports.countries[country.alpha2] = country; | ||
} | ||
var exportedAlpha3 = exports.countries[country.alpha3]; | ||
if (!exportedAlpha3 || exportedAlpha3.status === 'deleted') { | ||
exports.countries[country.alpha3] = country; | ||
} | ||
}); | ||
@@ -25,0 +33,0 @@ |
{ | ||
"name": "country-data", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"description": "Data about countries - like their ISO codes and currencies", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/OpenBookPrices/country-data", |
@@ -22,2 +22,6 @@ 'use strict'; | ||
}); | ||
it('should prefer assigned alpha2 country codes', function () { | ||
assert.equal( countries.SK.name, 'Slovakia'); | ||
assert.equal( countries.BY.name, 'Belarus'); | ||
}); | ||
}); | ||
@@ -24,0 +28,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
225285
10244