|
1 | | -importcountryUtilfrom"i18n-iso-countries"; |
| 1 | +import*ascountriesModulefrom"i18n-iso-countries"; |
2 | 2 |
|
3 | 3 | // eslint-disable-next-line @typescript-eslint/no-var-requires |
4 | 4 | constenLocale=require("i18n-iso-countries/langs/en.json"); |
5 | 5 |
|
| 6 | +// Handle environments where the module might be exposed on either the module |
| 7 | +// object itself or under a `default` export. |
| 8 | +constcountryUtil= |
| 9 | +(countriesModuleasunknownas{default?:typeofcountriesModule}).default?? |
| 10 | +countriesModule; |
| 11 | + |
6 | 12 | countryUtil.registerLocale(enLocale); |
7 | 13 |
|
8 | 14 | exportfunctionalpha3ToCountryName(code?:string|null):string|null{ |
|