# @theorchard/countries

## 3.0.1

### Patch Changes

-   Migrate lodash imports to lodash-es in build scripts

## 3.0.0

### Major Changes

-   Kosovo alpha-3 code changed from XXK -> XKX

## 2.1.1

### Patch Changes

-   Antartica is included as a country.

## 2.1.0

### Minor Changes

-   Matches both two and three letter ISO codes.

## 2.0.0

### Major Changes

-   Full rework of the library to provide a cleaner api and added logic for continents and territories. Also adds localization support for continents and updated locales for countries.
-   Added "createTerritory" function to define a custom territory with included or excluded countries.
-   Added "getContinent" function to return a continent with included countries.
-   Added "getContinents" function to return all continents with countries.
-   Added "getCountry" function to return a single country by code. Unknown country if no match.
-   Added "getCountryByCode" function to return a single country by code. Undefined if no match.
-   Added "getCountryByName" function to return a single country by its english name. Undefined if no match.
-   Added "getGlobal" function to return the "global" country.
-   Added "getTerritory" function to return predefined territories.

### Breaking Changes

-   All functions now uses an config object to specify the locale. e.g. `{ locale: 'fr' }`.
-   The `country.name` property remains the english name and the translated name is defined in the `country.label` field.
-   "getCountries" does no longer include the "global" country by default. To include it you can specify the { includeGlobal: true } option.
-   Removed the `COUNTRIES` constant export. Use the `getCountries` function instead.
-   Removed the `COUNTRIES_BY_CODE` constant export. Use the `getCountries` and `getCountry` functions instead.
-   "Antarctica" is no longer returned as a country, but is now defined as a continent only.

## 1.2.1

### Patch Changes

-   Added exports fields to package.json

## 1.2.0

### Minor Changes

-   Updated internal country info libraries.
-   Country information now includes continent.
-   Exports new `getCountriesByContinent` function.

## 1.1.0

### Minor Changes

-   Add "getCountries" and "getCountryName" functions with localization support.

## 1.0.0

### Minor Changes

-   Initial commit to export list of country objects.
