@brixtol/country-names
Advanced tools
Comparing version 1.1.2 to 1.2.0
## _CHANGELOG_ | ||
### 1.2.0 - 24/10/2021 | ||
- Added `CountryCodes` type export | ||
### 1.1.2 - 10/09/2021 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "@brixtol/country-names", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Mappings for 2 letter (Alpha 2) country codes to English country name", | ||
@@ -51,4 +51,4 @@ "author": { | ||
"@brixtol/eslint-config": "^1.0.1", | ||
"@brixtol/prettier-config": "^1.0.3", | ||
"@brixtol/rollup-config": "^1.2.0", | ||
"@brixtol/prettier-config": "^1.2.0", | ||
"@brixtol/rollup-config": "^1.4.0", | ||
"@brixtol/tsconfig": "^1.0.0", | ||
@@ -55,0 +55,0 @@ "esm": "^3.2.25", |
@@ -495,2 +495,6 @@ export interface ICountries { | ||
} | ||
/** | ||
* Country code Keys (3166-1 alpha-2) | ||
*/ | ||
export declare type CountryCodes<T = keyof ICountries> = T; | ||
export declare const Countries: ICountries; | ||
@@ -502,2 +506,2 @@ /** | ||
*/ | ||
export declare const getCountryName: (code: keyof ICountries) => string; | ||
export declare const getCountryName: (code: CountryCodes) => string; |
@@ -37,7 +37,7 @@ ## @brixtol/country-names | ||
```javascript | ||
import { getCountryName } from "@brixtol/country-names"; | ||
import { getCountryName } from '@brixtol/country-names'; | ||
const sweden = getCountryName("SE"); // Sweden | ||
const netherlands = getCountryName("nl"); // Netherlands | ||
const usa = getCountryName("uS"); // United States of America | ||
const sweden = getCountryName('SE'); // Sweden | ||
const netherlands = getCountryName('nl'); // Netherlands | ||
const usa = getCountryName('uS'); // United States of America | ||
``` | ||
@@ -48,3 +48,3 @@ | ||
```javascript | ||
import { Countries, ICountries } from "@brixtol/country-names"; | ||
import { Countries, ICountries, CountryCodes } from '@brixtol/country-names'; | ||
@@ -62,2 +62,6 @@ // Mapping Object | ||
ICountries.RU; // Russian Federation | ||
// Country Codes | ||
CountryCodes: // SE | NL | RU etc etc | ||
``` | ||
@@ -64,0 +68,0 @@ |
Sorry, the diff of this file is not supported yet
27247
570
85