@dlghq/country-codes
Advanced tools
Comparing version
{ | ||
"name": "@dlghq/country-codes", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"main": "src/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/dialogs/dialog-country-codes", |
@@ -6,13 +6,12 @@ /* | ||
// $FlowFixMe: Required module not found | ||
import countries from './meta/countries.json'; | ||
import countries from './meta/countries.json'; | ||
export type CountryInfo = { | ||
alpha: string, | ||
codes: string[], | ||
emoji: ?string | ||
}; | ||
export type CountryInfo = { | ||
alpha: string, | ||
codes: string[], | ||
emoji: ?string | ||
}; | ||
export function getCountries(): CountryInfo[] { | ||
return countries; | ||
}; | ||
export function getCountries(): CountryInfo[] { | ||
return countries; | ||
} |
@@ -6,14 +6,13 @@ /* | ||
// $FlowFixMe: Required module not found | ||
import en from './meta/en.json'; | ||
import ru from './meta/ru.json'; | ||
import en from './meta/en.json'; | ||
import ru from './meta/ru.json'; | ||
export function getCountryName(alpha: string, locale: string): string { | ||
switch (locale) { | ||
case 'ru': | ||
return ru[alpha]; | ||
default: | ||
export function getCountryName(alpha: string, locale: string): string { | ||
switch (locale) { | ||
case 'ru': | ||
return ru[alpha]; | ||
default: | ||
return en[alpha]; | ||
} | ||
}; | ||
} | ||
} | ||
@@ -20,0 +19,0 @@ export function getCountryNamesArray(alpha: string): string[] { |
@@ -10,10 +10,4 @@ /* | ||
export type { | ||
CountryInfo | ||
}; | ||
export type { CountryInfo }; | ||
export { | ||
getCountries, | ||
getCountryName, | ||
getCountryNamesArray | ||
} | ||
export { getCountries, getCountryName, getCountryNamesArray }; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%37268
-0.18%2304
-0.35%