@sil/data 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sil-data.cjs
CHANGED
|
@@ -4162,6 +4162,14 @@ function getNeighbors(alpha2) {
|
|
|
4162
4162
|
if (!geo) return [];
|
|
4163
4163
|
return geo.neighbors.map((code) => getCountryGeography(code)).filter((g) => g !== void 0);
|
|
4164
4164
|
}
|
|
4165
|
+
function doCountriesBorder(alpha2A, alpha2B) {
|
|
4166
|
+
const geoA = getCountryGeography(alpha2A);
|
|
4167
|
+
if (!geoA) return false;
|
|
4168
|
+
const geoB = getCountryGeography(alpha2B);
|
|
4169
|
+
if (!geoB) return false;
|
|
4170
|
+
const upper = geoB.alpha2.toUpperCase();
|
|
4171
|
+
return geoA.neighbors.some((n) => n.toUpperCase() === upper);
|
|
4172
|
+
}
|
|
4165
4173
|
function getFlagSvgUrl(alpha2) {
|
|
4166
4174
|
return `https://flagcdn.com/${alpha2.toLowerCase()}.svg`;
|
|
4167
4175
|
}
|
|
@@ -5013,6 +5021,7 @@ exports.continents = continents;
|
|
|
5013
5021
|
exports.countries = countries;
|
|
5014
5022
|
exports.countryGeography = countryGeography;
|
|
5015
5023
|
exports.currencies = currencies;
|
|
5024
|
+
exports.doCountriesBorder = doCountriesBorder;
|
|
5016
5025
|
exports.flagData = flagData;
|
|
5017
5026
|
exports.getCapitalCity = getCapitalCity;
|
|
5018
5027
|
exports.getCitiesByCountry = getCitiesByCountry;
|