@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.
@@ -0,0 +1 @@
1
+ export {};
@@ -31,3 +31,18 @@ export declare function getCountriesByClimate(climate: CountryGeography["climate
31
31
  * Get all countries that neighbour a given country.
32
32
  */
33
33
  export declare function getNeighbors(alpha2: string): CountryGeography[];
34
+ /**
35
+ * Check whether two countries share a land border.
36
+ *
37
+ * @param alpha2A - ISO 3166-1 alpha-2 code of the first country (case-insensitive).
38
+ * @param alpha2B - ISO 3166-1 alpha-2 code of the second country (case-insensitive).
39
+ * @returns `true` if the two countries are neighbours, `false` otherwise.
40
+ * Also returns `false` if either code is not found in the geography data.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * doCountriesBorder("DE", "FR"); // true – Germany and France share a border
45
+ * doCountriesBorder("DE", "US"); // false – no shared border
46
+ * ```
47
+ */
48
+ export declare function doCountriesBorder(alpha2A: string, alpha2B: string): boolean;
@@ -22,7 +22,7 @@ export { cities, getCitiesByCountry, getCapitalCity, getCitiesByPopulation, sear
22
22
  export { states, getStatesByCountry, getStateByCode, getStatesByType, } from "./data/states.js";
23
23
  export { continents, getContinentByCode } from "./data/continents.js";
24
24
  export { currencies, getCurrencyByCode, getCurrencyByCountry, } from "./data/currencies.js";
25
- export { countryGeography, getCountryGeography, getLandlockedCountries, getCountriesByClimate, getNeighbors, } from "./data/geography.js";
25
+ export { countryGeography, getCountryGeography, getLandlockedCountries, getCountriesByClimate, getNeighbors, doCountriesBorder, } from "./data/geography.js";
26
26
  export { flagData, getFlagData, getFlagsByColor, getSimilarFlags, getFlagSvgUrl, getFlagPngUrl, getCountryMapSvgUrl, } from "./data/flags.js";
27
27
  export { haversineDistance, bearing, bearingToCardinal, getDistanceBetweenCountries, getDirectionBetweenCountries, compareTemperature, compareSize, getHemisphere, getGeoHints, } from "./utils/geo.js";
28
28
  export type { GeoHint, Hemisphere } from "./utils/geo.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sil/data",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "A comprehensive collection of reusable world data: countries, phone codes, flags, cities, states, provinces and more",
5
5
  "type": "module",
6
6
  "main": "./dist/sil-data.cjs",