@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.js
CHANGED
|
@@ -4160,6 +4160,14 @@ function getNeighbors(alpha2) {
|
|
|
4160
4160
|
if (!geo) return [];
|
|
4161
4161
|
return geo.neighbors.map((code) => getCountryGeography(code)).filter((g) => g !== void 0);
|
|
4162
4162
|
}
|
|
4163
|
+
function doCountriesBorder(alpha2A, alpha2B) {
|
|
4164
|
+
const geoA = getCountryGeography(alpha2A);
|
|
4165
|
+
if (!geoA) return false;
|
|
4166
|
+
const geoB = getCountryGeography(alpha2B);
|
|
4167
|
+
if (!geoB) return false;
|
|
4168
|
+
const upper = geoB.alpha2.toUpperCase();
|
|
4169
|
+
return geoA.neighbors.some((n) => n.toUpperCase() === upper);
|
|
4170
|
+
}
|
|
4163
4171
|
function getFlagSvgUrl(alpha2) {
|
|
4164
4172
|
return `https://flagcdn.com/${alpha2.toLowerCase()}.svg`;
|
|
4165
4173
|
}
|
|
@@ -5012,6 +5020,7 @@ export {
|
|
|
5012
5020
|
countries,
|
|
5013
5021
|
countryGeography,
|
|
5014
5022
|
currencies,
|
|
5023
|
+
doCountriesBorder,
|
|
5015
5024
|
flagData,
|
|
5016
5025
|
getCapitalCity,
|
|
5017
5026
|
getCitiesByCountry,
|