Util to get list of countries
This commit is contained in:
parent
dad75f76bd
commit
fe885ae6de
1 changed files with 18 additions and 0 deletions
18
ui/util/country.js
Normal file
18
ui/util/country.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { countries as countryData } from 'country-data';
|
||||
|
||||
export const COUNTRIES = Array.from(
|
||||
new Set(
|
||||
countryData.all
|
||||
.filter((country) => country.status !== 'deleted')
|
||||
.map((country) => country.name)
|
||||
.sort((a, b) => {
|
||||
if (a > b) {
|
||||
return 1;
|
||||
}
|
||||
if (b > a) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
)
|
||||
);
|
Loading…
Reference in a new issue