countries-geo 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +62 -0
- package/dist/cities.d.ts +8 -0
- package/dist/cities.js +20 -0
- package/dist/continents.d.ts +5 -0
- package/dist/continents.js +8 -0
- package/dist/countries.d.ts +6 -0
- package/dist/countries.js +14 -0
- package/dist/data.json +691 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +14 -0
- package/dist/states.d.ts +13 -0
- package/dist/states.js +17 -0
- package/dist/utils/cities.d.ts +5 -0
- package/dist/utils/cities.js +66 -0
- package/dist/utils/continents.d.ts +2 -0
- package/dist/utils/continents.js +10 -0
- package/dist/utils/countries.d.ts +3 -0
- package/dist/utils/countries.js +20 -0
- package/dist/utils/interface.d.ts +21 -0
- package/dist/utils/interface.js +2 -0
- package/dist/utils/states.d.ts +10 -0
- package/dist/utils/states.js +29 -0
- package/package.json +32 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Shu Ding
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://countries-geo.vercel.app">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/godfrednanaowusu/countries-geo/blob/main/www/public/logo.png">
|
|
5
|
+
<img alt="Countries Geo logo" src="https://github.com/godfrednanaowusu/countries-geo/blob/main/www/public/logo.png" height="128">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
<h1>Countries Geo</h1>
|
|
9
|
+
|
|
10
|
+
[](https://npmjs.com/package/countries-geo)
|
|
11
|
+
[](https://npmjs.com/package/countries-geo)
|
|
12
|
+
[](https://npmjs.com/package/countries-geo/LICENSE.md)
|
|
13
|
+
[](https://npmjs.com/package/countries-geo)
|
|
14
|
+
[](https://github.com/godfrednanaowusu/countries-geo)
|
|
15
|
+
[](https://github.com/godfrednanaowusu/countries-geo)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
Utility that provide simple functions to improve the ease of fetching Continents, Countries, States and Cities..
|
|
22
|
+
|
|
23
|
+
- Visit our [Site](https://countries-geo.vercel.app) to learn more.
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
Visit [https://countries-geo.vercel.app/docs](https://countries-geo.vercel.app/docs) to view the full documentation.
|
|
28
|
+
|
|
29
|
+
## Contributing
|
|
30
|
+
|
|
31
|
+
Contributions to Countries Geo are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/contributing.md) to make sure you have a smooth experience contributing to Countries Geo.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
### with Yarn
|
|
36
|
+
```sh filename="shell" copy
|
|
37
|
+
$ yarn add countries-geo
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### with npm
|
|
41
|
+
```sh filename="shell" copy
|
|
42
|
+
$ npm i countries-geo
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### with pnpm
|
|
46
|
+
```sh filename="shell" copy
|
|
47
|
+
$ pnpm add countries-geo
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### with Bun
|
|
51
|
+
```sh filename="shell" copy
|
|
52
|
+
$ bun add countries-geo
|
|
53
|
+
````
|
|
54
|
+
|
|
55
|
+
## Support Countries Geo
|
|
56
|
+
|
|
57
|
+
To support this project, kindly click on this link.
|
|
58
|
+
[[Contribute](https://opencollective.com/countries-geo/contribute)]
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT © [Godfred Nana Owusu](https://github.com/godfrednanaowusu)
|
package/dist/cities.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
getAll: import("./utils/interface").TCity[];
|
|
3
|
+
sortByIsoCode: import("./utils/interface").TCity[];
|
|
4
|
+
getByCountry: (iso: string) => import("./utils/interface").TCity[];
|
|
5
|
+
getByState: (iso: string) => import("./utils/interface").TCity[];
|
|
6
|
+
getByContinent: (iso: string) => import("./utils/interface").TCity[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
package/dist/cities.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cities_1 = require("./utils/cities");
|
|
4
|
+
// Get a list of all cities.
|
|
5
|
+
const getAll = (0, cities_1.cities)()?.sort((a, b) => a.name.localeCompare(b.name));
|
|
6
|
+
// Get an isoCode sorted cities
|
|
7
|
+
const sortByIsoCode = (0, cities_1.cities)()?.sort((a, b) => a.iso.localeCompare(b.iso));
|
|
8
|
+
// Get a state filtered cities
|
|
9
|
+
const getByState = (iso) => (0, cities_1.cities_by_state)(iso);
|
|
10
|
+
// Get a country filtered cities
|
|
11
|
+
const getByCountry = (iso) => (0, cities_1.cities_by_country)(iso);
|
|
12
|
+
// Get a continent filtered cities
|
|
13
|
+
const getByContinent = (iso) => (0, cities_1.cities_by_continent)(iso);
|
|
14
|
+
exports.default = {
|
|
15
|
+
getAll,
|
|
16
|
+
sortByIsoCode,
|
|
17
|
+
getByCountry,
|
|
18
|
+
getByState,
|
|
19
|
+
getByContinent
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const continents_1 = require("./utils/continents");
|
|
4
|
+
// Get a list of all continents.
|
|
5
|
+
const getAll = (0, continents_1.continents)()?.sort((a, b) => a.name.localeCompare(b.name));
|
|
6
|
+
// Get an isoCode sorted continents
|
|
7
|
+
const sortByIsoCode = (0, continents_1.continents)()?.sort((a, b) => a.iso.localeCompare(b.iso));
|
|
8
|
+
exports.default = { getAll, sortByIsoCode };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const countries_1 = require("./utils/countries");
|
|
4
|
+
// Get a list of all countries.
|
|
5
|
+
const getAll = (0, countries_1.countries)()?.sort((a, b) => a.name.localeCompare(b.name));
|
|
6
|
+
// Get an isoCode sorted countries
|
|
7
|
+
const sortByIsoCode = (0, countries_1.countries)()?.sort((a, b) => a.iso.localeCompare(b.iso));
|
|
8
|
+
// Get a continent filtered countries
|
|
9
|
+
const getByContinent = (iso) => (0, countries_1.countries_by_continent)(iso);
|
|
10
|
+
exports.default = {
|
|
11
|
+
getAll,
|
|
12
|
+
sortByIsoCode,
|
|
13
|
+
getByContinent,
|
|
14
|
+
};
|
package/dist/data.json
ADDED
|
@@ -0,0 +1,691 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "i": "AF", "n": "Africa", "cn": [
|
|
3
|
+
{ "i": "DZ", "n": "Algeria", "s": [] },
|
|
4
|
+
{ "i": "AO", "n": "Angola", "s": [] },
|
|
5
|
+
{ "i": "BJ", "n": "Benin", "s": [] },
|
|
6
|
+
{ "i": "BW", "n": "Botswana", "s": [] },
|
|
7
|
+
{ "i": "BF", "n": "Burkina Faso", "s": [] },
|
|
8
|
+
{ "i": "BI", "n": "Burundi", "s": [] },
|
|
9
|
+
{ "i": "CV", "n": "Cabo Verde", "s": [] },
|
|
10
|
+
{ "i": "CM", "n": "Cameroon", "s": [] },
|
|
11
|
+
{ "i": "CF", "n": "Central African Republic", "s": [] },
|
|
12
|
+
{ "i": "TD", "n": "Chad", "s": [] },
|
|
13
|
+
{ "i": "KM", "n": "Comoros", "s": [] },
|
|
14
|
+
{ "i": "CD", "n": "Democratic Republic of the Congo", "s": [] },
|
|
15
|
+
{ "i": "CG", "n": "Republic of the Congo", "s": [] },
|
|
16
|
+
{ "i": "CI", "n": "Côte d'Ivoire", "s": [] },
|
|
17
|
+
{ "i": "DJ", "n": "Djibouti", "s": [] },
|
|
18
|
+
{ "i": "EG", "n": "Egypt", "s": [] },
|
|
19
|
+
{ "i": "GQ", "n": "Equatorial Guinea", "s": [] },
|
|
20
|
+
{ "i": "ER", "n": "Eritrea", "s": [] },
|
|
21
|
+
{ "i": "SZ", "n": "Eswatini", "s": [] },
|
|
22
|
+
{ "i": "ET", "n": "Ethiopia", "s": [] },
|
|
23
|
+
{ "i": "GA", "n": "Gabon", "s": [] },
|
|
24
|
+
{ "i": "GM", "n": "Gambia", "s": [] },
|
|
25
|
+
{ "i": "GH", "n": "Ghana", "s": [
|
|
26
|
+
{ "i": "AA", "n": "Greater Accra", "c": [
|
|
27
|
+
{ "i": "AC", "n": "Accra Central" },
|
|
28
|
+
{ "i": "TE", "n": "Tema" },
|
|
29
|
+
{ "i": "ACH", "n": "Achimota" },
|
|
30
|
+
{ "i": "AD", "n": "Adenta" },
|
|
31
|
+
{ "i": "AS", "n": "Ashaiman" },
|
|
32
|
+
{ "i": "DO", "n": "Dodowa" },
|
|
33
|
+
{ "i": "DA", "n": "Dawhenya" },
|
|
34
|
+
{ "i": "LE", "n": "Lashibi" },
|
|
35
|
+
{ "i": "MA", "n": "Madina" },
|
|
36
|
+
{ "i": "NI", "n": "Nungua" },
|
|
37
|
+
{ "i": "LA", "n": "Labadi" },
|
|
38
|
+
{ "i": "OS", "n": "Osu" },
|
|
39
|
+
{ "i": "LEG", "n": "Legon" },
|
|
40
|
+
{ "i": "TS", "n": "Teshie" },
|
|
41
|
+
{ "i": "KA", "n": "Kaneshie" },
|
|
42
|
+
{ "i": "KO", "n": "Korle Bu" },
|
|
43
|
+
{ "i": "KW", "n": "Kwabenya" },
|
|
44
|
+
{ "i": "AB", "n": "Abokobi" },
|
|
45
|
+
{ "i": "AM", "n": "Amasaman" },
|
|
46
|
+
{ "i": "PR", "n": "Prampram" },
|
|
47
|
+
{ "i": "SE", "n": "Sege" },
|
|
48
|
+
{ "i": "SA", "n": "Sakumono" },
|
|
49
|
+
{ "i": "SP", "n": "Spintex" },
|
|
50
|
+
{ "i": "TA", "n": "Taifa" },
|
|
51
|
+
{ "i": "TR", "n": "Trassaco Valley" },
|
|
52
|
+
{ "i": "DZ", "n": "Dzorwulu" },
|
|
53
|
+
{ "i": "EA", "n": "East Legon" },
|
|
54
|
+
{ "i": "HA", "n": "Haatso" },
|
|
55
|
+
{ "i": "LP", "n": "Lapaz" },
|
|
56
|
+
{ "i": "MC", "n": "McCarthy Hill" },
|
|
57
|
+
{ "i": "MI", "n": "Mile 7" },
|
|
58
|
+
{ "i": "OD", "n": "Odorkor" },
|
|
59
|
+
{ "i": "OB", "n": "Oblogo" },
|
|
60
|
+
{ "i": "OY", "n": "Oyibi" },
|
|
61
|
+
{ "i": "PE", "n": "Pokuase" },
|
|
62
|
+
{ "i": "SH", "n": "Shiashie" },
|
|
63
|
+
{ "i": "SU", "n": "Sukura" },
|
|
64
|
+
{ "i": "TA", "n": "Tabora" },
|
|
65
|
+
{ "i": "TU", "n": "Tudu" },
|
|
66
|
+
{ "i": "WE", "n": "Weija" },
|
|
67
|
+
{ "i": "ZO", "n": "Zongo Junction" },
|
|
68
|
+
{ "i": "ADM", "n": "Adabraka" },
|
|
69
|
+
{ "i": "AGR", "n": "Agbogba" },
|
|
70
|
+
{ "i": "AIR", "n": "Airport Residential Area" },
|
|
71
|
+
{ "i": "ALG", "n": "Alajo" },
|
|
72
|
+
{ "i": "APO", "n": "Apollo" },
|
|
73
|
+
{ "i": "ATI", "n": "Atomic" },
|
|
74
|
+
{ "i": "BAN", "n": "Banana Inn" },
|
|
75
|
+
{ "i": "BUK", "n": "Bukom" },
|
|
76
|
+
{ "i": "CAN", "n": "Cantonments" },
|
|
77
|
+
{ "i": "CHR", "n": "Chorkor" },
|
|
78
|
+
{ "i": "DAN", "n": "Dansoman" },
|
|
79
|
+
{ "i": "FAF", "n": "Fafraha" },
|
|
80
|
+
{ "i": "GIM", "n": "Gimpa" },
|
|
81
|
+
{ "i": "JAM", "n": "Jamestown" },
|
|
82
|
+
{ "i": "KIS", "n": "Kisseman" },
|
|
83
|
+
{ "i": "KOK", "n": "Kokomlemle" },
|
|
84
|
+
{ "i": "MAM", "n": "Mamprobi" },
|
|
85
|
+
{ "i": "NII", "n": "Nii Boi Town" },
|
|
86
|
+
{ "i": "OPP", "n": "Opeibea" },
|
|
87
|
+
{ "i": "PAN", "n": "Pantang" },
|
|
88
|
+
{ "i": "RID", "n": "Ridge" },
|
|
89
|
+
{ "i": "SAN", "n": "Santa Maria" },
|
|
90
|
+
{ "i": "SOW", "n": "Sowutuom" },
|
|
91
|
+
{ "i": "TAN", "n": "Tantra Hills" },
|
|
92
|
+
{ "i": "TES", "n": "Tesano" },
|
|
93
|
+
{ "i": "ZEN", "n": "Zenka" }
|
|
94
|
+
] },
|
|
95
|
+
{ "i": "AH", "n": "Ashanti", "c": [
|
|
96
|
+
{ "i": "KS", "n": "Kumasi City" },
|
|
97
|
+
{ "i": "AD", "n": "Adum" },
|
|
98
|
+
{ "i": "BA", "n": "Bantama" },
|
|
99
|
+
{ "i": "KN", "n": "Kejetia" },
|
|
100
|
+
{ "i": "AS", "n": "Asokwa" },
|
|
101
|
+
{ "i": "AT", "n": "Atonsu" },
|
|
102
|
+
{ "i": "SU", "n": "Suame" },
|
|
103
|
+
{ "i": "AB", "n": "Abrepo" },
|
|
104
|
+
{ "i": "TA", "n": "Tafo" },
|
|
105
|
+
{ "i": "KW", "n": "Kwadaso" },
|
|
106
|
+
{ "i": "NH", "n": "Nhyiaeso" },
|
|
107
|
+
{ "i": "MA", "n": "Manhyia" },
|
|
108
|
+
{ "i": "SA", "n": "Santasi" },
|
|
109
|
+
{ "i": "PA", "n": "Patasi" },
|
|
110
|
+
{ "i": "OB", "n": "Obuasi" },
|
|
111
|
+
{ "i": "EJ", "n": "Ejisu" },
|
|
112
|
+
{ "i": "KO", "n": "Konongo" },
|
|
113
|
+
{ "i": "AG", "n": "Agogo" },
|
|
114
|
+
{ "i": "MF", "n": "Mampong" },
|
|
115
|
+
{ "i": "BE", "n": "Bekwai" },
|
|
116
|
+
{ "i": "JC", "n": "Juaso" },
|
|
117
|
+
{ "i": "NS", "n": "Nsuta" },
|
|
118
|
+
{ "i": "OD", "n": "Offinso" },
|
|
119
|
+
{ "i": "TE", "n": "Tepa" },
|
|
120
|
+
{ "i": "JU", "n": "Jamasi" },
|
|
121
|
+
{ "i": "BO", "n": "Bompata" },
|
|
122
|
+
{ "i": "KU", "n": "Kumawu" },
|
|
123
|
+
{ "i": "NK", "n": "Nkawie" },
|
|
124
|
+
{ "i": "AF", "n": "Afrancho" },
|
|
125
|
+
{ "i": "NY", "n": "Nyinahin" },
|
|
126
|
+
{ "i": "DW", "n": "Dwinyama" },
|
|
127
|
+
{ "i": "AH", "n": "Ahwiaa" },
|
|
128
|
+
{ "i": "KE", "n": "Kenyasi" },
|
|
129
|
+
{ "i": "PR", "n": "Pramso" },
|
|
130
|
+
{ "i": "AM", "n": "Ampabame" },
|
|
131
|
+
{ "i": "TI", "n": "Tikrom" },
|
|
132
|
+
{ "i": "KY", "n": "Kwaso" },
|
|
133
|
+
{ "i": "AP", "n": "Apromase" },
|
|
134
|
+
{ "i": "HE", "n": "Hemang" },
|
|
135
|
+
{ "i": "BR", "n": "Breso" },
|
|
136
|
+
{ "i": "KJ", "n": "Kodie" },
|
|
137
|
+
{ "i": "SE", "n": "Sekyere" },
|
|
138
|
+
{ "i": "FO", "n": "Foase" },
|
|
139
|
+
{ "i": "YO", "n": "Yonso" },
|
|
140
|
+
{ "i": "KT", "n": "KNUST Campus" },
|
|
141
|
+
{ "i": "KA", "n": "Kaase Industrial Area" },
|
|
142
|
+
{ "i": "DE", "n": "Deduako" },
|
|
143
|
+
{ "i": "TR", "n": "Trebuom" },
|
|
144
|
+
{ "i": "BU", "n": "Buokrom Estate" },
|
|
145
|
+
{ "i": "TN", "n": "Tanoso" }
|
|
146
|
+
] },
|
|
147
|
+
{ "i": "BO", "n": "Bono", "c": [
|
|
148
|
+
{ "i": "SU", "n": "Sunyani" },
|
|
149
|
+
{ "i": "BE", "n": "Berekum" },
|
|
150
|
+
{ "i": "DO", "n": "Dormaa Ahenkro" },
|
|
151
|
+
{ "i": "WA", "n": "Wamfie" },
|
|
152
|
+
{ "i": "NK", "n": "Nkoranza" },
|
|
153
|
+
{ "i": "JA", "n": "Jaman North" },
|
|
154
|
+
{ "i": "TE", "n": "Techiman (Food Trade Hub)" },
|
|
155
|
+
{ "i": "WE", "n": "Wenchi" },
|
|
156
|
+
{ "i": "NS", "n": "Nsawkaw" }
|
|
157
|
+
] },
|
|
158
|
+
{ "i": "BE", "n": "Bono East", "c": [
|
|
159
|
+
{ "i": "TE", "n": "Techiman" },
|
|
160
|
+
{ "i": "KP", "n": "Kintampo" },
|
|
161
|
+
{ "i": "NK", "n": "Nkoranza" },
|
|
162
|
+
{ "i": "PR", "n": "Prang" },
|
|
163
|
+
{ "i": "YE", "n": "Yeji (Fishing Port)" },
|
|
164
|
+
{ "i": "KA", "n": "Kajaji" },
|
|
165
|
+
{ "i": "JE", "n": "Jema" },
|
|
166
|
+
{ "i": "BU", "n": "Buoyem" }
|
|
167
|
+
] },
|
|
168
|
+
{ "i": "CP", "n": "Central", "c": [
|
|
169
|
+
{ "i": "CA", "n": "Cape Coast" },
|
|
170
|
+
{ "i": "EL", "n": "Elmina (Historic Port)" },
|
|
171
|
+
{ "i": "SW", "n": "Swedru" },
|
|
172
|
+
{ "i": "KA", "n": "Kasoa (Urban Hub)" },
|
|
173
|
+
{ "i": "WI", "n": "Winneba" },
|
|
174
|
+
{ "i": "DU", "n": "Dunkwa-on-Offin" },
|
|
175
|
+
{ "i": "AS", "n": "Assin Fosu" },
|
|
176
|
+
{ "i": "SA", "n": "Saltpond (Oil Discovery Site)" }
|
|
177
|
+
] },
|
|
178
|
+
{ "i": "EP", "n": "Eastern", "c": [
|
|
179
|
+
{ "i": "KO", "n": "Koforidua" },
|
|
180
|
+
{ "i": "AK", "n": "Akim Oda" },
|
|
181
|
+
{ "i": "NS", "n": "Nsawam" },
|
|
182
|
+
{ "i": "SU", "n": "Suhum" },
|
|
183
|
+
{ "i": "MP", "n": "Mpraeso (Kwahu Plateau)" },
|
|
184
|
+
{ "i": "DO", "n": "Donkorkrom" },
|
|
185
|
+
{ "i": "AB", "n": "Aburi (Botanical Gardens)" },
|
|
186
|
+
{ "i": "AS", "n": "Asamankese" }
|
|
187
|
+
] },
|
|
188
|
+
{ "i": "NP", "n": "Northern", "c": [
|
|
189
|
+
{ "i": "TA", "n": "Tamale" },
|
|
190
|
+
{ "i": "YE", "n": "Yendi" },
|
|
191
|
+
{ "i": "SA", "n": "Savelugu" },
|
|
192
|
+
{ "i": "GU", "n": "Gushegu" },
|
|
193
|
+
{ "i": "KP", "n": "Karaga" },
|
|
194
|
+
{ "i": "BU", "n": "Buipe (Transport Hub)" },
|
|
195
|
+
{ "i": "DA", "n": "Damongo" },
|
|
196
|
+
{ "i": "WA", "n": "Walewale" }
|
|
197
|
+
] },
|
|
198
|
+
{ "i": "SV", "n": "Savannah", "c": [
|
|
199
|
+
{ "i": "DA", "n": "Damongo (Regional Capital)" },
|
|
200
|
+
{ "i": "BO", "n": "Bole" },
|
|
201
|
+
{ "i": "DO", "n": "Daboya (Salt Mining Town)" },
|
|
202
|
+
{ "i": "SO", "n": "Sawla" },
|
|
203
|
+
{ "i": "LA", "n": "Larabanga (Mystic Stone)" },
|
|
204
|
+
{ "i": "BU", "n": "Busunu" },
|
|
205
|
+
{ "i": "FU", "n": "Fufulso" },
|
|
206
|
+
{ "i": "TU", "n": "Tuna" },
|
|
207
|
+
{ "i": "KP", "n": "Kpalbe" }
|
|
208
|
+
] },
|
|
209
|
+
{ "i": "UE", "n": "Upper East", "c": [
|
|
210
|
+
{ "i": "BO", "n": "Bolgatanga (Regional Capital)" },
|
|
211
|
+
{ "i": "BI", "n": "Bawku" },
|
|
212
|
+
{ "i": "ZO", "n": "Zuarungu" },
|
|
213
|
+
{ "i": "NA", "n": "Navrongo" },
|
|
214
|
+
{ "i": "PA", "n": "Paga (Sacred Crocodile Ponds)" },
|
|
215
|
+
{ "i": "TE", "n": "Tongo" },
|
|
216
|
+
{ "i": "BU", "n": "Bongo" },
|
|
217
|
+
{ "i": "TA", "n": "Talensi" },
|
|
218
|
+
{ "i": "KA", "n": "Kassena-Nankana" }
|
|
219
|
+
] },
|
|
220
|
+
{ "i": "UW", "n": "Upper West", "c": [
|
|
221
|
+
{ "i": "WA", "n": "Wa (Regional Capital)" },
|
|
222
|
+
{ "i": "TU", "n": "Tumu" },
|
|
223
|
+
{ "i": "JI", "n": "Jirapa" },
|
|
224
|
+
{ "i": "NA", "n": "Nadowli" },
|
|
225
|
+
{ "i": "LA", "n": "Lawra" },
|
|
226
|
+
{ "i": "HA", "n": "Hamile (Burkina Faso Border)" },
|
|
227
|
+
{ "i": "WE", "n": "Wellembelle" },
|
|
228
|
+
{ "i": "DA", "n": "Daffiama" },
|
|
229
|
+
{ "i": "FU", "n": "Funsi" }
|
|
230
|
+
] },
|
|
231
|
+
{ "i": "TV", "n": "Volta", "c": [
|
|
232
|
+
{ "i": "HO", "n": "Ho (Regional Capital)" },
|
|
233
|
+
{ "i": "KE", "n": "Keta (Historic Slave Port)" },
|
|
234
|
+
{ "i": "KP", "n": "Kpando" },
|
|
235
|
+
{ "i": "HO", "n": "Hohoe" },
|
|
236
|
+
{ "i": "JO", "n": "Jasikan" },
|
|
237
|
+
{ "i": "DA", "n": "Denu (Beach Resort)" },
|
|
238
|
+
{ "i": "AF", "n": "Afadjato (Highest Peak in Ghana)" },
|
|
239
|
+
{ "i": "TO", "n": "Togome" },
|
|
240
|
+
{ "i": "PE", "n": "Peki" }
|
|
241
|
+
] },
|
|
242
|
+
{ "i": "WP", "n": "Western", "c": [
|
|
243
|
+
{ "i": "SE", "n": "Sekondi-Takoradi (Regional Capital)" },
|
|
244
|
+
{ "i": "TA", "n": "Tarkwa (Gold Mining Hub)" },
|
|
245
|
+
{ "i": "AS", "n": "Axim (Historic Fort)" },
|
|
246
|
+
{ "i": "EL", "n": "Elubo (Côte d'Ivoire Border)" },
|
|
247
|
+
{ "i": "BO", "n": "Bogoso" },
|
|
248
|
+
{ "i": "PP", "n": "Prestea" },
|
|
249
|
+
{ "i": "DI", "n": "Dixcove (Fishing Harbor)" },
|
|
250
|
+
{ "i": "HA", "n": "Half Assini" },
|
|
251
|
+
{ "i": "NS", "n": "Nsuaem" }
|
|
252
|
+
] },
|
|
253
|
+
{ "i": "NE", "n": "North East", "c": [
|
|
254
|
+
{ "i": "NA", "n": "Nalerigu (Regional Capital)" },
|
|
255
|
+
{ "i": "WA", "n": "Walewale" },
|
|
256
|
+
{ "i": "GA", "n": "Gambaga" },
|
|
257
|
+
{ "i": "BI", "n": "Bunkpurugu" },
|
|
258
|
+
{ "i": "CH", "n": "Chereponi" },
|
|
259
|
+
{ "i": "YA", "n": "Yagaba" },
|
|
260
|
+
{ "i": "KU", "n": "Kunkwa" },
|
|
261
|
+
{ "i": "TE", "n": "Tempani" },
|
|
262
|
+
{ "i": "NK", "n": "Nakpanduri" }
|
|
263
|
+
] },
|
|
264
|
+
{ "i": "OT", "n": "Oti", "c": [
|
|
265
|
+
{ "i": "DA", "n": "Dambai (Regional Capital)" },
|
|
266
|
+
{ "i": "KA", "n": "Kadjebi" },
|
|
267
|
+
{ "i": "JA", "n": "Jasikan" },
|
|
268
|
+
{ "i": "KP", "n": "Kpassa" },
|
|
269
|
+
{ "i": "NK", "n": "Nkwanta" },
|
|
270
|
+
{ "i": "BI", "n": "Bisunu (Volta Lake Port)" },
|
|
271
|
+
{ "i": "CH", "n": "Chinderi" },
|
|
272
|
+
{ "i": "PU", "n": "Pusupu" },
|
|
273
|
+
{ "i": "KE", "n": "Kete Krachi" }
|
|
274
|
+
] },
|
|
275
|
+
{ "i": "WN", "n": "Western North", "c": [
|
|
276
|
+
{ "i": "SE", "n": "Sefwi Wiawso (Regional Capital)" },
|
|
277
|
+
{ "i": "BI", "n": "Bibiani (Gold & Timber Hub)" },
|
|
278
|
+
{ "i": "AS", "n": "Asawinso" },
|
|
279
|
+
{ "i": "AD", "n": "Adjoafua" },
|
|
280
|
+
{ "i": "AM", "n": "Awaso (Bauxite Mining)" },
|
|
281
|
+
{ "i": "JU", "n": "Juaboso" },
|
|
282
|
+
{ "i": "BE", "n": "Bodi" },
|
|
283
|
+
{ "i": "SU", "n": "Suhum" },
|
|
284
|
+
{ "i": "KE", "n": "Kenyasi" }
|
|
285
|
+
] },
|
|
286
|
+
{ "i": "AS", "n": "Ahafo", "c": [
|
|
287
|
+
{ "i": "GO", "n": "Goaso" },
|
|
288
|
+
{ "i": "HW", "n": "Hwidiem" },
|
|
289
|
+
{ "i": "KU", "n": "Kukuom" },
|
|
290
|
+
{ "i": "MA", "n": "Manfo" },
|
|
291
|
+
{ "i": "AC", "n": "Acherensua" },
|
|
292
|
+
{ "i": "DU", "n": "Duayaw Nkwanta" },
|
|
293
|
+
{ "i": "KE", "n": "Kenyasi (Mining Hub)" },
|
|
294
|
+
{ "i": "NK", "n": "Nkasiem" },
|
|
295
|
+
{ "i": "TE", "n": "Terchire" }
|
|
296
|
+
] }
|
|
297
|
+
] },
|
|
298
|
+
{ "i": "GN", "n": "Guinea", "s": [] },
|
|
299
|
+
{ "i": "GW", "n": "Guinea-Bissau", "s": [] },
|
|
300
|
+
{ "i": "KE", "n": "Kenya", "s": [] },
|
|
301
|
+
{ "i": "LS", "n": "Lesotho", "s": [] },
|
|
302
|
+
{ "i": "LR", "n": "Liberia", "s": [] },
|
|
303
|
+
{ "i": "LY", "n": "Libya", "s": [] },
|
|
304
|
+
{ "i": "MG", "n": "Madagascar", "s": [] },
|
|
305
|
+
{ "i": "MW", "n": "Malawi", "s": [] },
|
|
306
|
+
{ "i": "ML", "n": "Mali", "s": [] },
|
|
307
|
+
{ "i": "MR", "n": "Mauritania", "s": [] },
|
|
308
|
+
{ "i": "MU", "n": "Mauritius", "s": [] },
|
|
309
|
+
{ "i": "YT", "n": "Mayotte", "s": [] },
|
|
310
|
+
{ "i": "MA", "n": "Morocco", "s": [] },
|
|
311
|
+
{ "i": "MZ", "n": "Mozambique", "s": [] },
|
|
312
|
+
{ "i": "NA", "n": "Namibia", "s": [] },
|
|
313
|
+
{ "i": "NE", "n": "Niger", "s": [] },
|
|
314
|
+
{ "i": "NG", "n": "Nigeria", "s": [
|
|
315
|
+
{ "i": "AB", "n": "Abia", "c": [] },
|
|
316
|
+
{ "i": "AD", "n": "Adamawa", "c": [] },
|
|
317
|
+
{ "i": "AK", "n": "Akwa Ibom", "c": [] },
|
|
318
|
+
{ "i": "AN", "n": "Anambra", "c": [] },
|
|
319
|
+
{ "i": "BA", "n": "Bauchi", "c": [] },
|
|
320
|
+
{ "i": "BY", "n": "Bayelsa", "c": [] },
|
|
321
|
+
{ "i": "BE", "n": "Benue", "c": [] },
|
|
322
|
+
{ "i": "BO", "n": "Borno", "c": [] },
|
|
323
|
+
{ "i": "CR", "n": "Cross River", "c": [] },
|
|
324
|
+
{ "i": "DE", "n": "Delta", "c": [] },
|
|
325
|
+
{ "i": "EB", "n": "Ebonyi", "c": [] },
|
|
326
|
+
{ "i": "ED", "n": "Edo", "c": [] },
|
|
327
|
+
{ "i": "EK", "n": "Ekiti", "c": [] },
|
|
328
|
+
{ "i": "EN", "n": "Enugu", "c": [] },
|
|
329
|
+
{ "i": "FC", "n": "Federal Capital Territory", "c": [] },
|
|
330
|
+
{ "i": "GO", "n": "Gombe", "c": [] },
|
|
331
|
+
{ "i": "IM", "n": "Imo", "c": [] },
|
|
332
|
+
{ "i": "JI", "n": "Jigawa", "c": [] },
|
|
333
|
+
{ "i": "KD", "n": "Kaduna", "c": [] },
|
|
334
|
+
{ "i": "KN", "n": "Kano", "c": [] },
|
|
335
|
+
{ "i": "KT", "n": "Katsina", "c": [] },
|
|
336
|
+
{ "i": "KE", "n": "Kebbi", "c": [] },
|
|
337
|
+
{ "i": "KO", "n": "Kogi", "c": [] },
|
|
338
|
+
{ "i": "KW", "n": "Kwara", "c": [] },
|
|
339
|
+
{ "i": "LA", "n": "Lagos", "c": [] },
|
|
340
|
+
{ "i": "NA", "n": "Nasarawa", "c": [] },
|
|
341
|
+
{ "i": "NI", "n": "Niger", "c": [] },
|
|
342
|
+
{ "i": "OG", "n": "Ogun", "c": [
|
|
343
|
+
{ "i": "AB", "n": "Abeokuta" },
|
|
344
|
+
{ "i": "ABE", "n": "Abigi" },
|
|
345
|
+
{ "i": "ADO", "n": "Ado-Odo" },
|
|
346
|
+
{ "i": "AGB", "n": "Agbara" },
|
|
347
|
+
{ "i": "AK", "n": "Akowonjo" },
|
|
348
|
+
{ "i": "AR", "n": "Arepo" },
|
|
349
|
+
{ "i": "AY", "n": "Ayetoro" },
|
|
350
|
+
{ "i": "EB", "n": "Ebute Ikorodu" },
|
|
351
|
+
{ "i": "EW", "n": "Ewekoro" },
|
|
352
|
+
{ "i": "IF", "n": "Ifo" },
|
|
353
|
+
{ "i": "IJ", "n": "Ijebu-Igbo" },
|
|
354
|
+
{ "i": "IJE", "n": "Ijebu-Ode" },
|
|
355
|
+
{ "i": "IJE2", "n": "Ijebu-Ife" },
|
|
356
|
+
{ "i": "IJE3", "n": "Ijebu-Mushin" },
|
|
357
|
+
{ "i": "IK", "n": "Ikene" },
|
|
358
|
+
{ "i": "IL", "n": "Ilaro" },
|
|
359
|
+
{ "i": "IMO", "n": "Imeko" },
|
|
360
|
+
{ "i": "IP", "n": "Ipokia" },
|
|
361
|
+
{ "i": "IS", "n": "Isara" },
|
|
362
|
+
{ "i": "IT", "n": "Itori" },
|
|
363
|
+
{ "i": "KO", "n": "Kobape" },
|
|
364
|
+
{ "i": "MO", "n": "Mowe" },
|
|
365
|
+
{ "i": "OB", "n": "Oba" },
|
|
366
|
+
{ "i": "OBA", "n": "Obalende" },
|
|
367
|
+
{ "i": "OD", "n": "Ode" },
|
|
368
|
+
{ "i": "ODE", "n": "Ode-Lemo" },
|
|
369
|
+
{ "i": "OG", "n": "Ogbere" },
|
|
370
|
+
{ "i": "OGB", "n": "Ogbogbo" },
|
|
371
|
+
{ "i": "OGE", "n": "Ogere" },
|
|
372
|
+
{ "i": "OK", "n": "Oke-Ata" },
|
|
373
|
+
{ "i": "OKE", "n": "Oke-Igbo" },
|
|
374
|
+
{ "i": "OL", "n": "Olorunda" },
|
|
375
|
+
{ "i": "OLO", "n": "Olorunsogo" },
|
|
376
|
+
{ "i": "ONI", "n": "Onigbedu" },
|
|
377
|
+
{ "i": "OPA", "n": "Opa" },
|
|
378
|
+
{ "i": "OPE", "n": "Opeji" },
|
|
379
|
+
{ "i": "OR", "n": "Orile" },
|
|
380
|
+
{ "i": "OS", "n": "Ososa" },
|
|
381
|
+
{ "i": "OW", "n": "Owode" },
|
|
382
|
+
{ "i": "OWE", "n": "Owode-Egba" },
|
|
383
|
+
{ "i": "OWO", "n": "Owowo" },
|
|
384
|
+
{ "i": "SA", "n": "Sagamu" },
|
|
385
|
+
{ "i": "SH", "n": "Shagamu" },
|
|
386
|
+
{ "i": "SI", "n": "Siun" },
|
|
387
|
+
{ "i": "TA", "n": "Tapa" },
|
|
388
|
+
{ "i": "WAS", "n": "Wasimi" },
|
|
389
|
+
{ "i": "ILU", "n": "Ilugun" },
|
|
390
|
+
{ "i": "IJU", "n": "Iju" },
|
|
391
|
+
{ "i": "ATA", "n": "Atan" },
|
|
392
|
+
{ "i": "IDI", "n": "Idi-Iroko" },
|
|
393
|
+
{ "i": "IGB", "n": "Igbesa" },
|
|
394
|
+
{ "i": "IKO", "n": "Ikorodu" },
|
|
395
|
+
{ "i": "ILA", "n": "Ilaro" },
|
|
396
|
+
{ "i": "IPA", "n": "Ipokia" },
|
|
397
|
+
{ "i": "ISA", "n": "Isaga" },
|
|
398
|
+
{ "i": "ITI", "n": "Itori" },
|
|
399
|
+
{ "i": "JEM", "n": "Jemta" },
|
|
400
|
+
{ "i": "KET", "n": "Ketu" },
|
|
401
|
+
{ "i": "LIS", "n": "Lisabi" },
|
|
402
|
+
{ "i": "MAG", "n": "Magboro" },
|
|
403
|
+
{ "i": "MAK", "n": "Makun" },
|
|
404
|
+
{ "i": "ODO", "n": "Odogbolu" },
|
|
405
|
+
{ "i": "OFI", "n": "Ofin" },
|
|
406
|
+
{ "i": "OGU", "n": "Ogudu" },
|
|
407
|
+
{ "i": "OKA", "n": "Oka-Akoko" },
|
|
408
|
+
{ "i": "OLI", "n": "Oliwo" },
|
|
409
|
+
{ "i": "OLU", "n": "Oluke" },
|
|
410
|
+
{ "i": "ONA", "n": "Onigbongbo" },
|
|
411
|
+
{ "i": "ORI", "n": "Orile-Ilugun" },
|
|
412
|
+
{ "i": "OSI", "n": "Osi" },
|
|
413
|
+
{ "i": "OTA", "n": "Ota" },
|
|
414
|
+
{ "i": "OWA", "n": "Owa" },
|
|
415
|
+
{ "i": "OWO", "n": "Owo" },
|
|
416
|
+
{ "i": "OYE", "n": "Oye" },
|
|
417
|
+
{ "i": "SAP", "n": "Sapade" },
|
|
418
|
+
{ "i": "SOK", "n": "Sokoto" },
|
|
419
|
+
{ "i": "TAL", "n": "Talafia" },
|
|
420
|
+
{ "i": "TIN", "n": "Tincan" },
|
|
421
|
+
{ "i": "TOG", "n": "Togun" },
|
|
422
|
+
{ "i": "TUN", "n": "Tuntun" },
|
|
423
|
+
{ "i": "WAS", "n": "Wasimi" },
|
|
424
|
+
{ "i": "YEW", "n": "Yewa" }
|
|
425
|
+
] },
|
|
426
|
+
{ "i": "ON", "n": "Ondo", "c": [] },
|
|
427
|
+
{ "i": "OS", "n": "Osun", "c": [] },
|
|
428
|
+
{ "i": "OY", "n": "Oyo", "c": [] },
|
|
429
|
+
{ "i": "PL", "n": "Plateau", "c": [] },
|
|
430
|
+
{ "i": "RI", "n": "Rivers", "c": [] },
|
|
431
|
+
{ "i": "SO", "n": "Sokoto", "c": [] },
|
|
432
|
+
{ "i": "TA", "n": "Taraba", "c": [] },
|
|
433
|
+
{ "i": "YO", "n": "Yobe", "c": [] },
|
|
434
|
+
{ "i": "ZA", "n": "Zamfara", "c": [] }
|
|
435
|
+
] },
|
|
436
|
+
{ "i": "RE", "n": "Réunion", "s": [] },
|
|
437
|
+
{ "i": "RW", "n": "Rwanda", "s": [] },
|
|
438
|
+
{ "i": "SH", "n": "Saint Helena", "s": [] },
|
|
439
|
+
{ "i": "ST", "n": "São Tomé and Príncipe", "s": [] },
|
|
440
|
+
{ "i": "SN", "n": "Senegal", "s": [] },
|
|
441
|
+
{ "i": "SC", "n": "Seychelles", "s": [] },
|
|
442
|
+
{ "i": "SL", "n": "Sierra Leone", "s": [] },
|
|
443
|
+
{ "i": "SO", "n": "Somalia", "s": [] },
|
|
444
|
+
{ "i": "ZA", "n": "South Africa", "s": [] },
|
|
445
|
+
{ "i": "SS", "n": "South Sudan", "s": [] },
|
|
446
|
+
{ "i": "SD", "n": "Sudan", "s": [] },
|
|
447
|
+
{ "i": "TZ", "n": "Tanzania", "s": [] },
|
|
448
|
+
{ "i": "TG", "n": "Togo", "s": [
|
|
449
|
+
{
|
|
450
|
+
"i": "MA",
|
|
451
|
+
"n": "Maritime",
|
|
452
|
+
"c": [
|
|
453
|
+
{ "i": "LO", "n": "Lomé" },
|
|
454
|
+
{ "i": "AN", "n": "Aného" },
|
|
455
|
+
{ "i": "TS", "n": "Tsévié" },
|
|
456
|
+
{ "i": "VA", "n": "Vogan" },
|
|
457
|
+
{ "i": "TA", "n": "Tabligbo" }
|
|
458
|
+
]
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"i": "PL",
|
|
462
|
+
"n": "Plateaux",
|
|
463
|
+
"c": [
|
|
464
|
+
{ "i": "AT", "n": "Atakpamé" },
|
|
465
|
+
{ "i": "KP", "n": "Kpalimé" },
|
|
466
|
+
{ "i": "BA", "n": "Badou" },
|
|
467
|
+
{ "i": "NK", "n": "Notsé" },
|
|
468
|
+
{ "i": "SO", "n": "Sotouboua" }
|
|
469
|
+
]
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"i": "CE",
|
|
473
|
+
"n": "Centrale",
|
|
474
|
+
"c": [
|
|
475
|
+
{ "i": "SO", "n": "Sokodé" },
|
|
476
|
+
{ "i": "TB", "n": "Tchamba" },
|
|
477
|
+
{ "i": "SR", "n": "Sotouboua" },
|
|
478
|
+
{ "i": "BA", "n": "Bafilo" }
|
|
479
|
+
]
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"i": "KA",
|
|
483
|
+
"n": "Kara",
|
|
484
|
+
"c": [
|
|
485
|
+
{ "i": "KA", "n": "Kara" },
|
|
486
|
+
{ "i": "BA", "n": "Bassar" },
|
|
487
|
+
{ "i": "NA", "n": "Niamtougou" },
|
|
488
|
+
{ "i": "PR", "n": "Pagouda" }
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"i": "SA",
|
|
493
|
+
"n": "Savanes",
|
|
494
|
+
"c": [
|
|
495
|
+
{ "i": "DA", "n": "Dapaong" },
|
|
496
|
+
{ "i": "MA", "n": "Mango" },
|
|
497
|
+
{ "i": "TI", "n": "Tandjouaré" },
|
|
498
|
+
{ "i": "CE", "n": "Cinkassé" }
|
|
499
|
+
]
|
|
500
|
+
}
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
{ "i": "TN", "n": "Tunisia", "s": [] },
|
|
504
|
+
{ "i": "UG", "n": "Uganda", "s": [] },
|
|
505
|
+
{ "i": "EH", "n": "Western Sahara", "s": [] },
|
|
506
|
+
{ "i": "ZM", "n": "Zambia", "s": [] },
|
|
507
|
+
{ "i": "ZW", "n": "Zimbabwe", "s": [] }
|
|
508
|
+
] },
|
|
509
|
+
{ "i": "AQ", "n": "Antarctica", "cn": [
|
|
510
|
+
{ "i": "AQ-ARG", "n": "Argentine Antarctica", "s": [] },
|
|
511
|
+
{ "i": "AQ-AUS", "n": "Australian Antarctic Territory", "s": [] },
|
|
512
|
+
{ "i": "AQ-CHL", "n": "Chilean Antarctic Territory", "s": [] },
|
|
513
|
+
{ "i": "AQ-FRA", "n": "Adélie Land (France)", "s": [] },
|
|
514
|
+
{ "i": "AQ-NZL", "n": "Ross Dependency (New Zealand)", "s": [] },
|
|
515
|
+
{ "i": "AQ-NOR", "n": "Queen Maud Land (Norway)", "s": [] },
|
|
516
|
+
{ "i": "AQ-GBR", "n": "British Antarctic Territory", "s": [] }
|
|
517
|
+
] },
|
|
518
|
+
{
|
|
519
|
+
"i": "AS",
|
|
520
|
+
"n": "Asia",
|
|
521
|
+
"cn": [
|
|
522
|
+
{ "i": "AF", "n": "Afghanistan", "s": [] },
|
|
523
|
+
{ "i": "AM", "n": "Armenia", "s": [] },
|
|
524
|
+
{ "i": "AZ", "n": "Azerbaijan", "s": [] },
|
|
525
|
+
{ "i": "BH", "n": "Bahrain", "s": [] },
|
|
526
|
+
{ "i": "BD", "n": "Bangladesh", "s": [] },
|
|
527
|
+
{ "i": "BT", "n": "Bhutan", "s": [] },
|
|
528
|
+
{ "i": "BN", "n": "Brunei Darussalam", "s": [] },
|
|
529
|
+
{ "i": "KH", "n": "Cambodia", "s": [] },
|
|
530
|
+
{ "i": "CN", "n": "China", "s": [] },
|
|
531
|
+
{ "i": "CY", "n": "Cyprus", "s": [] },
|
|
532
|
+
{ "i": "GE", "n": "Georgia", "s": [] },
|
|
533
|
+
{ "i": "IN", "n": "India", "s": [] },
|
|
534
|
+
{ "i": "ID", "n": "Indonesia", "s": [] },
|
|
535
|
+
{ "i": "IR", "n": "Iran", "s": [] },
|
|
536
|
+
{ "i": "IQ", "n": "Iraq", "s": [] },
|
|
537
|
+
{ "i": "IL", "n": "Israel", "s": [] },
|
|
538
|
+
{ "i": "JP", "n": "Japan", "s": [] },
|
|
539
|
+
{ "i": "JO", "n": "Jordan", "s": [] },
|
|
540
|
+
{ "i": "KZ", "n": "Kazakhstan", "s": [] },
|
|
541
|
+
{ "i": "KP", "n": "North Korea", "s": [] },
|
|
542
|
+
{ "i": "KR", "n": "South Korea", "s": [] },
|
|
543
|
+
{ "i": "KW", "n": "Kuwait", "s": [] },
|
|
544
|
+
{ "i": "KG", "n": "Kyrgyzstan", "s": [] },
|
|
545
|
+
{ "i": "LA", "n": "Laos", "s": [] },
|
|
546
|
+
{ "i": "LB", "n": "Lebanon", "s": [] },
|
|
547
|
+
{ "i": "MY", "n": "Malaysia", "s": [] },
|
|
548
|
+
{ "i": "MV", "n": "Maldives", "s": [] },
|
|
549
|
+
{ "i": "MN", "n": "Mongolia", "s": [] },
|
|
550
|
+
{ "i": "MM", "n": "Myanmar", "s": [] },
|
|
551
|
+
{ "i": "NP", "n": "Nepal", "s": [] },
|
|
552
|
+
{ "i": "OM", "n": "Oman", "s": [] },
|
|
553
|
+
{ "i": "PK", "n": "Pakistan", "s": [] },
|
|
554
|
+
{ "i": "PH", "n": "Philippines", "s": [] },
|
|
555
|
+
{ "i": "QA", "n": "Qatar", "s": [] },
|
|
556
|
+
{ "i": "RU", "n": "Russia", "s": [] },
|
|
557
|
+
{ "i": "SA", "n": "Saudi Arabia", "s": [] },
|
|
558
|
+
{ "i": "SG", "n": "Singapore", "s": [] },
|
|
559
|
+
{ "i": "LK", "n": "Sri Lanka", "s": [] },
|
|
560
|
+
{ "i": "SY", "n": "Syria", "s": [] },
|
|
561
|
+
{ "i": "TW", "n": "Taiwan", "s": [] },
|
|
562
|
+
{ "i": "TJ", "n": "Tajikistan", "s": [] },
|
|
563
|
+
{ "i": "TH", "n": "Thailand", "s": [] },
|
|
564
|
+
{ "i": "TL", "n": "Timor-Leste", "s": [] },
|
|
565
|
+
{ "i": "TR", "n": "Turkey", "s": [] },
|
|
566
|
+
{ "i": "TM", "n": "Turkmenistan", "s": [] },
|
|
567
|
+
{ "i": "AE", "n": "United Arab Emirates", "s": [] },
|
|
568
|
+
{ "i": "UZ", "n": "Uzbekistan", "s": [] },
|
|
569
|
+
{ "i": "VN", "n": "Vietnam", "s": [] },
|
|
570
|
+
{ "i": "YE", "n": "Yemen", "s": [] }
|
|
571
|
+
]
|
|
572
|
+
},
|
|
573
|
+
{ "i": "EU", "n": "Europe", "cn": [
|
|
574
|
+
{ "i": "AL", "n": "Albania", "s": [] },
|
|
575
|
+
{ "i": "AD", "n": "Andorra", "s": [] },
|
|
576
|
+
{ "i": "AT", "n": "Austria", "s": [] },
|
|
577
|
+
{ "i": "BY", "n": "Belarus", "s": [] },
|
|
578
|
+
{ "i": "BE", "n": "Belgium", "s": [] },
|
|
579
|
+
{ "i": "BA", "n": "Bosnia and Herzegovina", "s": [] },
|
|
580
|
+
{ "i": "BG", "n": "Bulgaria", "s": [] },
|
|
581
|
+
{ "i": "HR", "n": "Croatia", "s": [] },
|
|
582
|
+
{ "i": "CY", "n": "Cyprus", "s": [] },
|
|
583
|
+
{ "i": "CZ", "n": "Czech Republic", "s": [] },
|
|
584
|
+
{ "i": "DK", "n": "Denmark", "s": [] },
|
|
585
|
+
{ "i": "EE", "n": "Estonia", "s": [] },
|
|
586
|
+
{ "i": "FI", "n": "Finland", "s": [] },
|
|
587
|
+
{ "i": "FR", "n": "France", "s": [] },
|
|
588
|
+
{ "i": "DE", "n": "Germany", "s": [] },
|
|
589
|
+
{ "i": "GR", "n": "Greece", "s": [] },
|
|
590
|
+
{ "i": "HU", "n": "Hungary", "s": [] },
|
|
591
|
+
{ "i": "IS", "n": "Iceland", "s": [] },
|
|
592
|
+
{ "i": "IE", "n": "Ireland", "s": [] },
|
|
593
|
+
{ "i": "IT", "n": "Italy", "s": [] },
|
|
594
|
+
{ "i": "LV", "n": "Latvia", "s": [] },
|
|
595
|
+
{ "i": "LI", "n": "Liechtenstein", "s": [] },
|
|
596
|
+
{ "i": "LT", "n": "Lithuania", "s": [] },
|
|
597
|
+
{ "i": "LU", "n": "Luxembourg", "s": [] },
|
|
598
|
+
{ "i": "MT", "n": "Malta", "s": [] },
|
|
599
|
+
{ "i": "MD", "n": "Moldova", "s": [] },
|
|
600
|
+
{ "i": "MC", "n": "Monaco", "s": [] },
|
|
601
|
+
{ "i": "ME", "n": "Montenegro", "s": [] },
|
|
602
|
+
{ "i": "NL", "n": "Netherlands", "s": [] },
|
|
603
|
+
{ "i": "MK", "n": "North Macedonia", "s": [] },
|
|
604
|
+
{ "i": "NO", "n": "Norway", "s": [] },
|
|
605
|
+
{ "i": "PL", "n": "Poland", "s": [] },
|
|
606
|
+
{ "i": "PT", "n": "Portugal", "s": [] },
|
|
607
|
+
{ "i": "RO", "n": "Romania", "s": [] },
|
|
608
|
+
{ "i": "RU", "n": "Russia", "s": [] },
|
|
609
|
+
{ "i": "SM", "n": "San Marino", "s": [] },
|
|
610
|
+
{ "i": "RS", "n": "Serbia", "s": [] },
|
|
611
|
+
{ "i": "SK", "n": "Slovakia", "s": [] },
|
|
612
|
+
{ "i": "SI", "n": "Slovenia", "s": [] },
|
|
613
|
+
{ "i": "ES", "n": "Spain", "s": [] },
|
|
614
|
+
{ "i": "SE", "n": "Sweden", "s": [] },
|
|
615
|
+
{ "i": "CH", "n": "Switzerland", "s": [] },
|
|
616
|
+
{ "i": "TR", "n": "Turkey", "s": [] },
|
|
617
|
+
{ "i": "UA", "n": "Ukraine", "s": [] },
|
|
618
|
+
{ "i": "GB", "n": "United Kingdom", "s": [] },
|
|
619
|
+
{ "i": "VA", "n": "Vatican City", "s": [] }
|
|
620
|
+
] },
|
|
621
|
+
{ "i": "NA", "n": "North America", "cn": [
|
|
622
|
+
{ "i": "AG", "n": "Antigua and Barbuda", "s": [] },
|
|
623
|
+
{ "i": "BS", "n": "Bahamas", "s": [] },
|
|
624
|
+
{ "i": "BB", "n": "Barbados", "s": [] },
|
|
625
|
+
{ "i": "BZ", "n": "Belize", "s": [] },
|
|
626
|
+
{ "i": "CA", "n": "Canada", "s": [] },
|
|
627
|
+
{ "i": "CR", "n": "Costa Rica", "s": [] },
|
|
628
|
+
{ "i": "CU", "n": "Cuba", "s": [] },
|
|
629
|
+
{ "i": "DM", "n": "Dominica", "s": [] },
|
|
630
|
+
{ "i": "DO", "n": "Dominican Republic", "s": [] },
|
|
631
|
+
{ "i": "SV", "n": "El Salvador", "s": [] },
|
|
632
|
+
{ "i": "GD", "n": "Grenada", "s": [] },
|
|
633
|
+
{ "i": "GT", "n": "Guatemala", "s": [] },
|
|
634
|
+
{ "i": "HT", "n": "Haiti", "s": [] },
|
|
635
|
+
{ "i": "HN", "n": "Honduras", "s": [] },
|
|
636
|
+
{ "i": "JM", "n": "Jamaica", "s": [] },
|
|
637
|
+
{ "i": "MX", "n": "Mexico", "s": [] },
|
|
638
|
+
{ "i": "NI", "n": "Nicaragua", "s": [] },
|
|
639
|
+
{ "i": "PA", "n": "Panama", "s": [] },
|
|
640
|
+
{ "i": "KN", "n": "Saint Kitts and Nevis", "s": [] },
|
|
641
|
+
{ "i": "LC", "n": "Saint Lucia", "s": [] },
|
|
642
|
+
{ "i": "VC", "n": "Saint Vincent and the Grenadines", "s": [] },
|
|
643
|
+
{ "i": "TT", "n": "Trinidad and Tobago", "s": [] },
|
|
644
|
+
{ "i": "US", "n": "United States", "s": [] }
|
|
645
|
+
] },
|
|
646
|
+
{ "i": "OC", "n": "Oceania", "cn": [
|
|
647
|
+
{ "i": "AU", "n": "Australia", "s": [] },
|
|
648
|
+
{ "i": "FJ", "n": "Fiji", "s": [] },
|
|
649
|
+
{ "i": "KI", "n": "Kiribati", "s": [] },
|
|
650
|
+
{ "i": "MH", "n": "Marshall Islands", "s": [] },
|
|
651
|
+
{ "i": "FM", "n": "Micronesia", "s": [] },
|
|
652
|
+
{ "i": "NR", "n": "Nauru", "s": [] },
|
|
653
|
+
{ "i": "NZ", "n": "New Zealand", "s": [] },
|
|
654
|
+
{ "i": "PW", "n": "Palau", "s": [] },
|
|
655
|
+
{ "i": "PG", "n": "Papua New Guinea", "s": [] },
|
|
656
|
+
{ "i": "WS", "n": "Samoa", "s": [] },
|
|
657
|
+
{ "i": "SB", "n": "Solomon Islands", "s": [] },
|
|
658
|
+
{ "i": "TO", "n": "Tonga", "s": [] },
|
|
659
|
+
{ "i": "TV", "n": "Tuvalu", "s": [] },
|
|
660
|
+
{ "i": "VU", "n": "Vanuatu", "s": [] },
|
|
661
|
+
{ "i": "AS", "n": "American Samoa", "s": [] },
|
|
662
|
+
{ "i": "CK", "n": "Cook Islands", "s": [] },
|
|
663
|
+
{ "i": "TL", "n": "Easter Island (Chile)", "s": [] },
|
|
664
|
+
{ "i": "PF", "n": "French Polynesia", "s": [] },
|
|
665
|
+
{ "i": "GU", "n": "Guam", "s": [] },
|
|
666
|
+
{ "i": "NC", "n": "New Caledonia", "s": [] },
|
|
667
|
+
{ "i": "NU", "n": "Niue", "s": [] },
|
|
668
|
+
{ "i": "NF", "n": "Norfolk Island", "s": [] },
|
|
669
|
+
{ "i": "MP", "n": "Northern Mariana Islands", "s": [] },
|
|
670
|
+
{ "i": "UM", "n": "Pacific Remote Islands (US)", "s": [] },
|
|
671
|
+
{ "i": "PN", "n": "Pitcairn Islands", "s": [] },
|
|
672
|
+
{ "i": "TK", "n": "Tokelau", "s": [] },
|
|
673
|
+
{ "i": "WF", "n": "Wallis and Futuna", "s": [] }
|
|
674
|
+
] },
|
|
675
|
+
{ "i": "SA", "n": "South America", "cn": [
|
|
676
|
+
{ "i": "AR", "n": "Argentina", "s": [] },
|
|
677
|
+
{ "i": "BO", "n": "Bolivia", "s": [] },
|
|
678
|
+
{ "i": "BR", "n": "Brazil", "s": [] },
|
|
679
|
+
{ "i": "CL", "n": "Chile", "s": [] },
|
|
680
|
+
{ "i": "CO", "n": "Colombia", "s": [] },
|
|
681
|
+
{ "i": "EC", "n": "Ecuador", "s": [] },
|
|
682
|
+
{ "i": "FK", "n": "Falkland Islands (Islas Malvinas)", "s": [] },
|
|
683
|
+
{ "i": "GF", "n": "French Guiana", "s": [] },
|
|
684
|
+
{ "i": "GY", "n": "Guyana", "s": [] },
|
|
685
|
+
{ "i": "PY", "n": "Paraguay", "s": [] },
|
|
686
|
+
{ "i": "PE", "n": "Peru", "s": [] },
|
|
687
|
+
{ "i": "SR", "n": "Suriname", "s": [] },
|
|
688
|
+
{ "i": "UY", "n": "Uruguay", "s": [] },
|
|
689
|
+
{ "i": "VE", "n": "Venezuela", "s": [] }
|
|
690
|
+
] }
|
|
691
|
+
]
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Cities = exports.States = exports.Countries = exports.Continents = void 0;
|
|
7
|
+
const continents_1 = __importDefault(require("./continents"));
|
|
8
|
+
exports.Continents = continents_1.default;
|
|
9
|
+
const countries_1 = __importDefault(require("./countries"));
|
|
10
|
+
exports.Countries = countries_1.default;
|
|
11
|
+
const states_1 = __importDefault(require("./states"));
|
|
12
|
+
exports.States = states_1.default;
|
|
13
|
+
const cities_1 = __importDefault(require("./cities"));
|
|
14
|
+
exports.Cities = cities_1.default;
|
package/dist/states.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
getAll: import("./utils/interface").TState[];
|
|
3
|
+
sortByIsoCode: import("./utils/interface").TState[];
|
|
4
|
+
getByCountry: (iso: string) => {
|
|
5
|
+
iso: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}[];
|
|
8
|
+
getByContinent: (iso: string) => {
|
|
9
|
+
iso: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
package/dist/states.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const states_1 = require("./utils/states");
|
|
4
|
+
// Get a list of all states.
|
|
5
|
+
const getAll = (0, states_1.states)()?.sort((a, b) => a.name.localeCompare(b.name));
|
|
6
|
+
// Get an isoCode sorted states
|
|
7
|
+
const sortByIsoCode = (0, states_1.states)()?.sort((a, b) => a.iso.localeCompare(b.iso));
|
|
8
|
+
// Get a country filtered states
|
|
9
|
+
const getByCountry = (iso) => (0, states_1.states_by_country)(iso);
|
|
10
|
+
// Get a continent filtered states
|
|
11
|
+
const getByContinent = (iso) => (0, states_1.states_by_continent)(iso);
|
|
12
|
+
exports.default = {
|
|
13
|
+
getAll,
|
|
14
|
+
sortByIsoCode,
|
|
15
|
+
getByCountry,
|
|
16
|
+
getByContinent
|
|
17
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TCity } from './interface';
|
|
2
|
+
export declare const cities: () => TCity[];
|
|
3
|
+
export declare const cities_by_state: (iso: string) => TCity[];
|
|
4
|
+
export declare const cities_by_country: (iso: string) => TCity[];
|
|
5
|
+
export declare const cities_by_continent: (iso: string) => TCity[];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cities_by_continent = exports.cities_by_country = exports.cities_by_state = exports.cities = void 0;
|
|
7
|
+
const data_json_1 = __importDefault(require("../data.json"));
|
|
8
|
+
// Cities
|
|
9
|
+
const cities = () => data_json_1.default.flatMap(continent => continent.cn).flatMap(country => country.s || []).flatMap(state => state.c || []).map(city => ({ iso: city.i, name: city.n }));
|
|
10
|
+
exports.cities = cities;
|
|
11
|
+
const cities_by_state = (iso) => {
|
|
12
|
+
try {
|
|
13
|
+
// Validate input format (e.g., 'GH-AA')
|
|
14
|
+
if (!iso || typeof iso !== 'string' || iso.split('-').length !== 2) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
const [countryIso, stateIso] = iso.split('-');
|
|
18
|
+
// Safely traverse the data structure
|
|
19
|
+
if (!data_json_1.default || !Array.isArray(data_json_1.default))
|
|
20
|
+
return [];
|
|
21
|
+
for (const continent of data_json_1.default) {
|
|
22
|
+
if (!continent.cn || !Array.isArray(continent.cn))
|
|
23
|
+
continue;
|
|
24
|
+
for (const country of continent.cn) {
|
|
25
|
+
if (country.i === countryIso) {
|
|
26
|
+
// Check if states exist and are iterable
|
|
27
|
+
if (!country.s || !Array.isArray(country.s))
|
|
28
|
+
return [];
|
|
29
|
+
const state = country.s.find(s => s.i === stateIso);
|
|
30
|
+
// Check if cities exist and are iterable
|
|
31
|
+
if (state?.c && Array.isArray(state.c)) {
|
|
32
|
+
return state.c.map(city => ({
|
|
33
|
+
iso: `${countryIso}-${stateIso}-${city.i}`,
|
|
34
|
+
name: city.n
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
return []; // State found but no cities
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return []; // No matching country/state found
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('Error in cities_by_state:', error);
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.cities_by_state = cities_by_state;
|
|
49
|
+
const cities_by_country = (iso) => {
|
|
50
|
+
return data_json_1.default
|
|
51
|
+
.flatMap(continent => continent.cn)
|
|
52
|
+
.find(country => country.i === iso)
|
|
53
|
+
?.s?.flatMap(state => state.c || [])
|
|
54
|
+
?.map(city => ({ iso: city.i, name: city.n })) || [];
|
|
55
|
+
};
|
|
56
|
+
exports.cities_by_country = cities_by_country;
|
|
57
|
+
const cities_by_continent = (iso) => {
|
|
58
|
+
const continent = data_json_1.default.find(c => c.i === iso);
|
|
59
|
+
if (!continent)
|
|
60
|
+
return [];
|
|
61
|
+
return continent.cn
|
|
62
|
+
.flatMap(country => country.s || [])
|
|
63
|
+
.flatMap(state => state.c || [])
|
|
64
|
+
.map(city => ({ iso: city.i, name: city.n }));
|
|
65
|
+
};
|
|
66
|
+
exports.cities_by_continent = cities_by_continent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.continents = void 0;
|
|
7
|
+
const data_json_1 = __importDefault(require("../data.json"));
|
|
8
|
+
// Continents
|
|
9
|
+
const continents = () => data_json_1.default?.map(({ i, n }) => ({ iso: i, name: n }));
|
|
10
|
+
exports.continents = continents;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.countries_by_continent = exports.countries = void 0;
|
|
7
|
+
const data_json_1 = __importDefault(require("../data.json"));
|
|
8
|
+
// Countries
|
|
9
|
+
const countries = () => data_json_1.default?.flatMap(continent => continent?.cn?.map(country => ({ iso: country.i, name: country.n })));
|
|
10
|
+
exports.countries = countries;
|
|
11
|
+
const countries_by_continent = (iso) => {
|
|
12
|
+
const continent = data_json_1.default?.find(c => c.i === iso);
|
|
13
|
+
if (!continent)
|
|
14
|
+
return [];
|
|
15
|
+
return continent?.cn?.map(country => ({
|
|
16
|
+
iso: country.i,
|
|
17
|
+
name: country.n
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
exports.countries_by_continent = countries_by_continent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type TContinentData = {
|
|
2
|
+
i: string;
|
|
3
|
+
n: string;
|
|
4
|
+
cn: any[];
|
|
5
|
+
};
|
|
6
|
+
export type TContinent = {
|
|
7
|
+
iso: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
export type TCountry = {
|
|
11
|
+
iso: string;
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
export type TState = {
|
|
15
|
+
iso: string;
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
export type TCity = {
|
|
19
|
+
iso: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TState } from './interface';
|
|
2
|
+
export declare const states: () => TState[];
|
|
3
|
+
export declare const states_by_country: (iso: string) => {
|
|
4
|
+
iso: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const states_by_continent: (iso: string) => {
|
|
8
|
+
iso: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.states_by_continent = exports.states_by_country = exports.states = void 0;
|
|
7
|
+
const data_json_1 = __importDefault(require("../data.json"));
|
|
8
|
+
// States
|
|
9
|
+
const states = () => data_json_1.default.flatMap(continent => continent.cn).map(state => ({ iso: state.i, name: state.n }));
|
|
10
|
+
exports.states = states;
|
|
11
|
+
const states_by_country = (iso) => {
|
|
12
|
+
for (const continent of data_json_1.default) {
|
|
13
|
+
const country = continent.cn.find(c => c.i === iso);
|
|
14
|
+
if (country?.s) {
|
|
15
|
+
return country.s.map(state => ({ iso: state.i, name: state.n }));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return [];
|
|
19
|
+
};
|
|
20
|
+
exports.states_by_country = states_by_country;
|
|
21
|
+
const states_by_continent = (iso) => {
|
|
22
|
+
const continent = data_json_1.default.find(c => c.i === iso);
|
|
23
|
+
if (!continent)
|
|
24
|
+
return [];
|
|
25
|
+
return continent.cn
|
|
26
|
+
.flatMap(country => country.s || [])
|
|
27
|
+
.map(state => ({ iso: state.i, name: state.n }));
|
|
28
|
+
};
|
|
29
|
+
exports.states_by_continent = states_by_continent;
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "countries-geo",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Library for fetching Continents, Countries, States and its Cities",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": "https://github.com/godfrednanaowusu/countries-geo",
|
|
8
|
+
"bugs": "https://github.com/godfrednanaowusu/countries-geo/issues",
|
|
9
|
+
"homepage": "https://countries-geo.vercel.app",
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "latest",
|
|
18
|
+
"typescript": "latest"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/**/*"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"continents",
|
|
25
|
+
"countries",
|
|
26
|
+
"states",
|
|
27
|
+
"cities",
|
|
28
|
+
"geo data",
|
|
29
|
+
"countries-geo"
|
|
30
|
+
],
|
|
31
|
+
"packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
|
|
32
|
+
}
|