@innovayse/geo-atlas 2.0.2 → 2.2.0
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/README.md +84 -17
- package/dist/cjs/cities.d.ts +12 -0
- package/dist/cjs/cities.js +58 -0
- package/dist/cjs/data/atlas.json +1 -1
- package/dist/cjs/helpers/CountriesAtlas.d.ts +16 -72
- package/dist/cjs/helpers/CountriesAtlas.js +23 -188
- package/dist/cjs/helpers/CountriesData.d.ts +86 -0
- package/dist/cjs/helpers/CountriesData.js +157 -0
- package/dist/cjs/helpers/countryLoaders.d.ts +17 -0
- package/dist/cjs/helpers/countryLoaders.js +287 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/lite.d.ts +27 -0
- package/dist/cjs/lite.js +30 -0
- package/dist/cjs/types/country.interface.d.ts +2 -0
- package/dist/cjs/types/phone-code.interface.d.ts +2 -0
- package/dist/esm/cities.d.ts +12 -0
- package/dist/esm/cities.js +51 -0
- package/dist/esm/data/atlas.json +1 -1
- package/dist/esm/helpers/CountriesAtlas.d.ts +16 -72
- package/dist/esm/helpers/CountriesAtlas.js +22 -163
- package/dist/esm/helpers/CountriesData.d.ts +86 -0
- package/dist/esm/helpers/CountriesData.js +150 -0
- package/dist/esm/helpers/countryLoaders.d.ts +17 -0
- package/dist/esm/helpers/countryLoaders.js +262 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/lite.d.ts +27 -0
- package/dist/esm/lite.js +22 -0
- package/dist/esm/types/country.interface.d.ts +2 -0
- package/dist/esm/types/phone-code.interface.d.ts +2 -0
- package/package.json +13 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
/**
|
|
27
|
+
* Auto-generated static loader registry for per-country state/city data.
|
|
28
|
+
*
|
|
29
|
+
* Each entry uses an explicit string-literal dynamic import path, allowing
|
|
30
|
+
* bundlers (Vite, webpack, rollup) to statically analyze, bundle, and
|
|
31
|
+
* code-split country data. DO NOT EDIT MANUALLY.
|
|
32
|
+
*
|
|
33
|
+
* Regenerate with: npm run generate:loaders
|
|
34
|
+
*/
|
|
35
|
+
const countryLoaders = {
|
|
36
|
+
'ad': () => Promise.resolve().then(() => __importStar(require('../data/countries/ad.json'))),
|
|
37
|
+
'ae': () => Promise.resolve().then(() => __importStar(require('../data/countries/ae.json'))),
|
|
38
|
+
'af': () => Promise.resolve().then(() => __importStar(require('../data/countries/af.json'))),
|
|
39
|
+
'ag': () => Promise.resolve().then(() => __importStar(require('../data/countries/ag.json'))),
|
|
40
|
+
'ai': () => Promise.resolve().then(() => __importStar(require('../data/countries/ai.json'))),
|
|
41
|
+
'al': () => Promise.resolve().then(() => __importStar(require('../data/countries/al.json'))),
|
|
42
|
+
'am': () => Promise.resolve().then(() => __importStar(require('../data/countries/am.json'))),
|
|
43
|
+
'ao': () => Promise.resolve().then(() => __importStar(require('../data/countries/ao.json'))),
|
|
44
|
+
'aq': () => Promise.resolve().then(() => __importStar(require('../data/countries/aq.json'))),
|
|
45
|
+
'ar': () => Promise.resolve().then(() => __importStar(require('../data/countries/ar.json'))),
|
|
46
|
+
'as': () => Promise.resolve().then(() => __importStar(require('../data/countries/as.json'))),
|
|
47
|
+
'at': () => Promise.resolve().then(() => __importStar(require('../data/countries/at.json'))),
|
|
48
|
+
'au': () => Promise.resolve().then(() => __importStar(require('../data/countries/au.json'))),
|
|
49
|
+
'aw': () => Promise.resolve().then(() => __importStar(require('../data/countries/aw.json'))),
|
|
50
|
+
'ax': () => Promise.resolve().then(() => __importStar(require('../data/countries/ax.json'))),
|
|
51
|
+
'az': () => Promise.resolve().then(() => __importStar(require('../data/countries/az.json'))),
|
|
52
|
+
'ba': () => Promise.resolve().then(() => __importStar(require('../data/countries/ba.json'))),
|
|
53
|
+
'bb': () => Promise.resolve().then(() => __importStar(require('../data/countries/bb.json'))),
|
|
54
|
+
'bd': () => Promise.resolve().then(() => __importStar(require('../data/countries/bd.json'))),
|
|
55
|
+
'be': () => Promise.resolve().then(() => __importStar(require('../data/countries/be.json'))),
|
|
56
|
+
'bf': () => Promise.resolve().then(() => __importStar(require('../data/countries/bf.json'))),
|
|
57
|
+
'bg': () => Promise.resolve().then(() => __importStar(require('../data/countries/bg.json'))),
|
|
58
|
+
'bh': () => Promise.resolve().then(() => __importStar(require('../data/countries/bh.json'))),
|
|
59
|
+
'bi': () => Promise.resolve().then(() => __importStar(require('../data/countries/bi.json'))),
|
|
60
|
+
'bj': () => Promise.resolve().then(() => __importStar(require('../data/countries/bj.json'))),
|
|
61
|
+
'bl': () => Promise.resolve().then(() => __importStar(require('../data/countries/bl.json'))),
|
|
62
|
+
'bm': () => Promise.resolve().then(() => __importStar(require('../data/countries/bm.json'))),
|
|
63
|
+
'bn': () => Promise.resolve().then(() => __importStar(require('../data/countries/bn.json'))),
|
|
64
|
+
'bo': () => Promise.resolve().then(() => __importStar(require('../data/countries/bo.json'))),
|
|
65
|
+
'bq': () => Promise.resolve().then(() => __importStar(require('../data/countries/bq.json'))),
|
|
66
|
+
'br': () => Promise.resolve().then(() => __importStar(require('../data/countries/br.json'))),
|
|
67
|
+
'bs': () => Promise.resolve().then(() => __importStar(require('../data/countries/bs.json'))),
|
|
68
|
+
'bt': () => Promise.resolve().then(() => __importStar(require('../data/countries/bt.json'))),
|
|
69
|
+
'bv': () => Promise.resolve().then(() => __importStar(require('../data/countries/bv.json'))),
|
|
70
|
+
'bw': () => Promise.resolve().then(() => __importStar(require('../data/countries/bw.json'))),
|
|
71
|
+
'by': () => Promise.resolve().then(() => __importStar(require('../data/countries/by.json'))),
|
|
72
|
+
'bz': () => Promise.resolve().then(() => __importStar(require('../data/countries/bz.json'))),
|
|
73
|
+
'ca': () => Promise.resolve().then(() => __importStar(require('../data/countries/ca.json'))),
|
|
74
|
+
'cc': () => Promise.resolve().then(() => __importStar(require('../data/countries/cc.json'))),
|
|
75
|
+
'cd': () => Promise.resolve().then(() => __importStar(require('../data/countries/cd.json'))),
|
|
76
|
+
'cf': () => Promise.resolve().then(() => __importStar(require('../data/countries/cf.json'))),
|
|
77
|
+
'cg': () => Promise.resolve().then(() => __importStar(require('../data/countries/cg.json'))),
|
|
78
|
+
'ch': () => Promise.resolve().then(() => __importStar(require('../data/countries/ch.json'))),
|
|
79
|
+
'ci': () => Promise.resolve().then(() => __importStar(require('../data/countries/ci.json'))),
|
|
80
|
+
'ck': () => Promise.resolve().then(() => __importStar(require('../data/countries/ck.json'))),
|
|
81
|
+
'cl': () => Promise.resolve().then(() => __importStar(require('../data/countries/cl.json'))),
|
|
82
|
+
'cm': () => Promise.resolve().then(() => __importStar(require('../data/countries/cm.json'))),
|
|
83
|
+
'cn': () => Promise.resolve().then(() => __importStar(require('../data/countries/cn.json'))),
|
|
84
|
+
'co': () => Promise.resolve().then(() => __importStar(require('../data/countries/co.json'))),
|
|
85
|
+
'cr': () => Promise.resolve().then(() => __importStar(require('../data/countries/cr.json'))),
|
|
86
|
+
'cu': () => Promise.resolve().then(() => __importStar(require('../data/countries/cu.json'))),
|
|
87
|
+
'cv': () => Promise.resolve().then(() => __importStar(require('../data/countries/cv.json'))),
|
|
88
|
+
'cw': () => Promise.resolve().then(() => __importStar(require('../data/countries/cw.json'))),
|
|
89
|
+
'cx': () => Promise.resolve().then(() => __importStar(require('../data/countries/cx.json'))),
|
|
90
|
+
'cy': () => Promise.resolve().then(() => __importStar(require('../data/countries/cy.json'))),
|
|
91
|
+
'cz': () => Promise.resolve().then(() => __importStar(require('../data/countries/cz.json'))),
|
|
92
|
+
'de': () => Promise.resolve().then(() => __importStar(require('../data/countries/de.json'))),
|
|
93
|
+
'dj': () => Promise.resolve().then(() => __importStar(require('../data/countries/dj.json'))),
|
|
94
|
+
'dk': () => Promise.resolve().then(() => __importStar(require('../data/countries/dk.json'))),
|
|
95
|
+
'dm': () => Promise.resolve().then(() => __importStar(require('../data/countries/dm.json'))),
|
|
96
|
+
'do': () => Promise.resolve().then(() => __importStar(require('../data/countries/do.json'))),
|
|
97
|
+
'dz': () => Promise.resolve().then(() => __importStar(require('../data/countries/dz.json'))),
|
|
98
|
+
'ec': () => Promise.resolve().then(() => __importStar(require('../data/countries/ec.json'))),
|
|
99
|
+
'ee': () => Promise.resolve().then(() => __importStar(require('../data/countries/ee.json'))),
|
|
100
|
+
'eg': () => Promise.resolve().then(() => __importStar(require('../data/countries/eg.json'))),
|
|
101
|
+
'eh': () => Promise.resolve().then(() => __importStar(require('../data/countries/eh.json'))),
|
|
102
|
+
'er': () => Promise.resolve().then(() => __importStar(require('../data/countries/er.json'))),
|
|
103
|
+
'es': () => Promise.resolve().then(() => __importStar(require('../data/countries/es.json'))),
|
|
104
|
+
'et': () => Promise.resolve().then(() => __importStar(require('../data/countries/et.json'))),
|
|
105
|
+
'fi': () => Promise.resolve().then(() => __importStar(require('../data/countries/fi.json'))),
|
|
106
|
+
'fj': () => Promise.resolve().then(() => __importStar(require('../data/countries/fj.json'))),
|
|
107
|
+
'fk': () => Promise.resolve().then(() => __importStar(require('../data/countries/fk.json'))),
|
|
108
|
+
'fm': () => Promise.resolve().then(() => __importStar(require('../data/countries/fm.json'))),
|
|
109
|
+
'fo': () => Promise.resolve().then(() => __importStar(require('../data/countries/fo.json'))),
|
|
110
|
+
'fr': () => Promise.resolve().then(() => __importStar(require('../data/countries/fr.json'))),
|
|
111
|
+
'ga': () => Promise.resolve().then(() => __importStar(require('../data/countries/ga.json'))),
|
|
112
|
+
'gb': () => Promise.resolve().then(() => __importStar(require('../data/countries/gb.json'))),
|
|
113
|
+
'gd': () => Promise.resolve().then(() => __importStar(require('../data/countries/gd.json'))),
|
|
114
|
+
'ge': () => Promise.resolve().then(() => __importStar(require('../data/countries/ge.json'))),
|
|
115
|
+
'gf': () => Promise.resolve().then(() => __importStar(require('../data/countries/gf.json'))),
|
|
116
|
+
'gg': () => Promise.resolve().then(() => __importStar(require('../data/countries/gg.json'))),
|
|
117
|
+
'gh': () => Promise.resolve().then(() => __importStar(require('../data/countries/gh.json'))),
|
|
118
|
+
'gi': () => Promise.resolve().then(() => __importStar(require('../data/countries/gi.json'))),
|
|
119
|
+
'gl': () => Promise.resolve().then(() => __importStar(require('../data/countries/gl.json'))),
|
|
120
|
+
'gm': () => Promise.resolve().then(() => __importStar(require('../data/countries/gm.json'))),
|
|
121
|
+
'gn': () => Promise.resolve().then(() => __importStar(require('../data/countries/gn.json'))),
|
|
122
|
+
'gp': () => Promise.resolve().then(() => __importStar(require('../data/countries/gp.json'))),
|
|
123
|
+
'gq': () => Promise.resolve().then(() => __importStar(require('../data/countries/gq.json'))),
|
|
124
|
+
'gr': () => Promise.resolve().then(() => __importStar(require('../data/countries/gr.json'))),
|
|
125
|
+
'gs': () => Promise.resolve().then(() => __importStar(require('../data/countries/gs.json'))),
|
|
126
|
+
'gt': () => Promise.resolve().then(() => __importStar(require('../data/countries/gt.json'))),
|
|
127
|
+
'gu': () => Promise.resolve().then(() => __importStar(require('../data/countries/gu.json'))),
|
|
128
|
+
'gw': () => Promise.resolve().then(() => __importStar(require('../data/countries/gw.json'))),
|
|
129
|
+
'gy': () => Promise.resolve().then(() => __importStar(require('../data/countries/gy.json'))),
|
|
130
|
+
'hk': () => Promise.resolve().then(() => __importStar(require('../data/countries/hk.json'))),
|
|
131
|
+
'hm': () => Promise.resolve().then(() => __importStar(require('../data/countries/hm.json'))),
|
|
132
|
+
'hn': () => Promise.resolve().then(() => __importStar(require('../data/countries/hn.json'))),
|
|
133
|
+
'hr': () => Promise.resolve().then(() => __importStar(require('../data/countries/hr.json'))),
|
|
134
|
+
'ht': () => Promise.resolve().then(() => __importStar(require('../data/countries/ht.json'))),
|
|
135
|
+
'hu': () => Promise.resolve().then(() => __importStar(require('../data/countries/hu.json'))),
|
|
136
|
+
'id': () => Promise.resolve().then(() => __importStar(require('../data/countries/id.json'))),
|
|
137
|
+
'ie': () => Promise.resolve().then(() => __importStar(require('../data/countries/ie.json'))),
|
|
138
|
+
'il': () => Promise.resolve().then(() => __importStar(require('../data/countries/il.json'))),
|
|
139
|
+
'im': () => Promise.resolve().then(() => __importStar(require('../data/countries/im.json'))),
|
|
140
|
+
'in': () => Promise.resolve().then(() => __importStar(require('../data/countries/in.json'))),
|
|
141
|
+
'io': () => Promise.resolve().then(() => __importStar(require('../data/countries/io.json'))),
|
|
142
|
+
'iq': () => Promise.resolve().then(() => __importStar(require('../data/countries/iq.json'))),
|
|
143
|
+
'ir': () => Promise.resolve().then(() => __importStar(require('../data/countries/ir.json'))),
|
|
144
|
+
'is': () => Promise.resolve().then(() => __importStar(require('../data/countries/is.json'))),
|
|
145
|
+
'it': () => Promise.resolve().then(() => __importStar(require('../data/countries/it.json'))),
|
|
146
|
+
'je': () => Promise.resolve().then(() => __importStar(require('../data/countries/je.json'))),
|
|
147
|
+
'jm': () => Promise.resolve().then(() => __importStar(require('../data/countries/jm.json'))),
|
|
148
|
+
'jo': () => Promise.resolve().then(() => __importStar(require('../data/countries/jo.json'))),
|
|
149
|
+
'jp': () => Promise.resolve().then(() => __importStar(require('../data/countries/jp.json'))),
|
|
150
|
+
'ke': () => Promise.resolve().then(() => __importStar(require('../data/countries/ke.json'))),
|
|
151
|
+
'kg': () => Promise.resolve().then(() => __importStar(require('../data/countries/kg.json'))),
|
|
152
|
+
'kh': () => Promise.resolve().then(() => __importStar(require('../data/countries/kh.json'))),
|
|
153
|
+
'ki': () => Promise.resolve().then(() => __importStar(require('../data/countries/ki.json'))),
|
|
154
|
+
'km': () => Promise.resolve().then(() => __importStar(require('../data/countries/km.json'))),
|
|
155
|
+
'kn': () => Promise.resolve().then(() => __importStar(require('../data/countries/kn.json'))),
|
|
156
|
+
'kp': () => Promise.resolve().then(() => __importStar(require('../data/countries/kp.json'))),
|
|
157
|
+
'kr': () => Promise.resolve().then(() => __importStar(require('../data/countries/kr.json'))),
|
|
158
|
+
'kw': () => Promise.resolve().then(() => __importStar(require('../data/countries/kw.json'))),
|
|
159
|
+
'ky': () => Promise.resolve().then(() => __importStar(require('../data/countries/ky.json'))),
|
|
160
|
+
'kz': () => Promise.resolve().then(() => __importStar(require('../data/countries/kz.json'))),
|
|
161
|
+
'la': () => Promise.resolve().then(() => __importStar(require('../data/countries/la.json'))),
|
|
162
|
+
'lb': () => Promise.resolve().then(() => __importStar(require('../data/countries/lb.json'))),
|
|
163
|
+
'lc': () => Promise.resolve().then(() => __importStar(require('../data/countries/lc.json'))),
|
|
164
|
+
'li': () => Promise.resolve().then(() => __importStar(require('../data/countries/li.json'))),
|
|
165
|
+
'lk': () => Promise.resolve().then(() => __importStar(require('../data/countries/lk.json'))),
|
|
166
|
+
'lr': () => Promise.resolve().then(() => __importStar(require('../data/countries/lr.json'))),
|
|
167
|
+
'ls': () => Promise.resolve().then(() => __importStar(require('../data/countries/ls.json'))),
|
|
168
|
+
'lt': () => Promise.resolve().then(() => __importStar(require('../data/countries/lt.json'))),
|
|
169
|
+
'lu': () => Promise.resolve().then(() => __importStar(require('../data/countries/lu.json'))),
|
|
170
|
+
'lv': () => Promise.resolve().then(() => __importStar(require('../data/countries/lv.json'))),
|
|
171
|
+
'ly': () => Promise.resolve().then(() => __importStar(require('../data/countries/ly.json'))),
|
|
172
|
+
'ma': () => Promise.resolve().then(() => __importStar(require('../data/countries/ma.json'))),
|
|
173
|
+
'mc': () => Promise.resolve().then(() => __importStar(require('../data/countries/mc.json'))),
|
|
174
|
+
'md': () => Promise.resolve().then(() => __importStar(require('../data/countries/md.json'))),
|
|
175
|
+
'me': () => Promise.resolve().then(() => __importStar(require('../data/countries/me.json'))),
|
|
176
|
+
'mf': () => Promise.resolve().then(() => __importStar(require('../data/countries/mf.json'))),
|
|
177
|
+
'mg': () => Promise.resolve().then(() => __importStar(require('../data/countries/mg.json'))),
|
|
178
|
+
'mh': () => Promise.resolve().then(() => __importStar(require('../data/countries/mh.json'))),
|
|
179
|
+
'mk': () => Promise.resolve().then(() => __importStar(require('../data/countries/mk.json'))),
|
|
180
|
+
'ml': () => Promise.resolve().then(() => __importStar(require('../data/countries/ml.json'))),
|
|
181
|
+
'mm': () => Promise.resolve().then(() => __importStar(require('../data/countries/mm.json'))),
|
|
182
|
+
'mn': () => Promise.resolve().then(() => __importStar(require('../data/countries/mn.json'))),
|
|
183
|
+
'mo': () => Promise.resolve().then(() => __importStar(require('../data/countries/mo.json'))),
|
|
184
|
+
'mp': () => Promise.resolve().then(() => __importStar(require('../data/countries/mp.json'))),
|
|
185
|
+
'mq': () => Promise.resolve().then(() => __importStar(require('../data/countries/mq.json'))),
|
|
186
|
+
'mr': () => Promise.resolve().then(() => __importStar(require('../data/countries/mr.json'))),
|
|
187
|
+
'ms': () => Promise.resolve().then(() => __importStar(require('../data/countries/ms.json'))),
|
|
188
|
+
'mt': () => Promise.resolve().then(() => __importStar(require('../data/countries/mt.json'))),
|
|
189
|
+
'mu': () => Promise.resolve().then(() => __importStar(require('../data/countries/mu.json'))),
|
|
190
|
+
'mv': () => Promise.resolve().then(() => __importStar(require('../data/countries/mv.json'))),
|
|
191
|
+
'mw': () => Promise.resolve().then(() => __importStar(require('../data/countries/mw.json'))),
|
|
192
|
+
'mx': () => Promise.resolve().then(() => __importStar(require('../data/countries/mx.json'))),
|
|
193
|
+
'my': () => Promise.resolve().then(() => __importStar(require('../data/countries/my.json'))),
|
|
194
|
+
'mz': () => Promise.resolve().then(() => __importStar(require('../data/countries/mz.json'))),
|
|
195
|
+
'na': () => Promise.resolve().then(() => __importStar(require('../data/countries/na.json'))),
|
|
196
|
+
'nc': () => Promise.resolve().then(() => __importStar(require('../data/countries/nc.json'))),
|
|
197
|
+
'ne': () => Promise.resolve().then(() => __importStar(require('../data/countries/ne.json'))),
|
|
198
|
+
'nf': () => Promise.resolve().then(() => __importStar(require('../data/countries/nf.json'))),
|
|
199
|
+
'ng': () => Promise.resolve().then(() => __importStar(require('../data/countries/ng.json'))),
|
|
200
|
+
'ni': () => Promise.resolve().then(() => __importStar(require('../data/countries/ni.json'))),
|
|
201
|
+
'nl': () => Promise.resolve().then(() => __importStar(require('../data/countries/nl.json'))),
|
|
202
|
+
'no': () => Promise.resolve().then(() => __importStar(require('../data/countries/no.json'))),
|
|
203
|
+
'np': () => Promise.resolve().then(() => __importStar(require('../data/countries/np.json'))),
|
|
204
|
+
'nr': () => Promise.resolve().then(() => __importStar(require('../data/countries/nr.json'))),
|
|
205
|
+
'nu': () => Promise.resolve().then(() => __importStar(require('../data/countries/nu.json'))),
|
|
206
|
+
'nz': () => Promise.resolve().then(() => __importStar(require('../data/countries/nz.json'))),
|
|
207
|
+
'om': () => Promise.resolve().then(() => __importStar(require('../data/countries/om.json'))),
|
|
208
|
+
'pa': () => Promise.resolve().then(() => __importStar(require('../data/countries/pa.json'))),
|
|
209
|
+
'pe': () => Promise.resolve().then(() => __importStar(require('../data/countries/pe.json'))),
|
|
210
|
+
'pf': () => Promise.resolve().then(() => __importStar(require('../data/countries/pf.json'))),
|
|
211
|
+
'pg': () => Promise.resolve().then(() => __importStar(require('../data/countries/pg.json'))),
|
|
212
|
+
'ph': () => Promise.resolve().then(() => __importStar(require('../data/countries/ph.json'))),
|
|
213
|
+
'pk': () => Promise.resolve().then(() => __importStar(require('../data/countries/pk.json'))),
|
|
214
|
+
'pl': () => Promise.resolve().then(() => __importStar(require('../data/countries/pl.json'))),
|
|
215
|
+
'pm': () => Promise.resolve().then(() => __importStar(require('../data/countries/pm.json'))),
|
|
216
|
+
'pn': () => Promise.resolve().then(() => __importStar(require('../data/countries/pn.json'))),
|
|
217
|
+
'pr': () => Promise.resolve().then(() => __importStar(require('../data/countries/pr.json'))),
|
|
218
|
+
'ps': () => Promise.resolve().then(() => __importStar(require('../data/countries/ps.json'))),
|
|
219
|
+
'pt': () => Promise.resolve().then(() => __importStar(require('../data/countries/pt.json'))),
|
|
220
|
+
'pw': () => Promise.resolve().then(() => __importStar(require('../data/countries/pw.json'))),
|
|
221
|
+
'py': () => Promise.resolve().then(() => __importStar(require('../data/countries/py.json'))),
|
|
222
|
+
'qa': () => Promise.resolve().then(() => __importStar(require('../data/countries/qa.json'))),
|
|
223
|
+
're': () => Promise.resolve().then(() => __importStar(require('../data/countries/re.json'))),
|
|
224
|
+
'ro': () => Promise.resolve().then(() => __importStar(require('../data/countries/ro.json'))),
|
|
225
|
+
'rs': () => Promise.resolve().then(() => __importStar(require('../data/countries/rs.json'))),
|
|
226
|
+
'ru': () => Promise.resolve().then(() => __importStar(require('../data/countries/ru.json'))),
|
|
227
|
+
'rw': () => Promise.resolve().then(() => __importStar(require('../data/countries/rw.json'))),
|
|
228
|
+
'sa': () => Promise.resolve().then(() => __importStar(require('../data/countries/sa.json'))),
|
|
229
|
+
'sb': () => Promise.resolve().then(() => __importStar(require('../data/countries/sb.json'))),
|
|
230
|
+
'sc': () => Promise.resolve().then(() => __importStar(require('../data/countries/sc.json'))),
|
|
231
|
+
'sd': () => Promise.resolve().then(() => __importStar(require('../data/countries/sd.json'))),
|
|
232
|
+
'se': () => Promise.resolve().then(() => __importStar(require('../data/countries/se.json'))),
|
|
233
|
+
'sg': () => Promise.resolve().then(() => __importStar(require('../data/countries/sg.json'))),
|
|
234
|
+
'sh': () => Promise.resolve().then(() => __importStar(require('../data/countries/sh.json'))),
|
|
235
|
+
'si': () => Promise.resolve().then(() => __importStar(require('../data/countries/si.json'))),
|
|
236
|
+
'sj': () => Promise.resolve().then(() => __importStar(require('../data/countries/sj.json'))),
|
|
237
|
+
'sk': () => Promise.resolve().then(() => __importStar(require('../data/countries/sk.json'))),
|
|
238
|
+
'sl': () => Promise.resolve().then(() => __importStar(require('../data/countries/sl.json'))),
|
|
239
|
+
'sm': () => Promise.resolve().then(() => __importStar(require('../data/countries/sm.json'))),
|
|
240
|
+
'sn': () => Promise.resolve().then(() => __importStar(require('../data/countries/sn.json'))),
|
|
241
|
+
'so': () => Promise.resolve().then(() => __importStar(require('../data/countries/so.json'))),
|
|
242
|
+
'sr': () => Promise.resolve().then(() => __importStar(require('../data/countries/sr.json'))),
|
|
243
|
+
'ss': () => Promise.resolve().then(() => __importStar(require('../data/countries/ss.json'))),
|
|
244
|
+
'st': () => Promise.resolve().then(() => __importStar(require('../data/countries/st.json'))),
|
|
245
|
+
'sv': () => Promise.resolve().then(() => __importStar(require('../data/countries/sv.json'))),
|
|
246
|
+
'sx': () => Promise.resolve().then(() => __importStar(require('../data/countries/sx.json'))),
|
|
247
|
+
'sy': () => Promise.resolve().then(() => __importStar(require('../data/countries/sy.json'))),
|
|
248
|
+
'sz': () => Promise.resolve().then(() => __importStar(require('../data/countries/sz.json'))),
|
|
249
|
+
'tc': () => Promise.resolve().then(() => __importStar(require('../data/countries/tc.json'))),
|
|
250
|
+
'td': () => Promise.resolve().then(() => __importStar(require('../data/countries/td.json'))),
|
|
251
|
+
'tf': () => Promise.resolve().then(() => __importStar(require('../data/countries/tf.json'))),
|
|
252
|
+
'tg': () => Promise.resolve().then(() => __importStar(require('../data/countries/tg.json'))),
|
|
253
|
+
'th': () => Promise.resolve().then(() => __importStar(require('../data/countries/th.json'))),
|
|
254
|
+
'tj': () => Promise.resolve().then(() => __importStar(require('../data/countries/tj.json'))),
|
|
255
|
+
'tk': () => Promise.resolve().then(() => __importStar(require('../data/countries/tk.json'))),
|
|
256
|
+
'tl': () => Promise.resolve().then(() => __importStar(require('../data/countries/tl.json'))),
|
|
257
|
+
'tm': () => Promise.resolve().then(() => __importStar(require('../data/countries/tm.json'))),
|
|
258
|
+
'tn': () => Promise.resolve().then(() => __importStar(require('../data/countries/tn.json'))),
|
|
259
|
+
'to': () => Promise.resolve().then(() => __importStar(require('../data/countries/to.json'))),
|
|
260
|
+
'tr': () => Promise.resolve().then(() => __importStar(require('../data/countries/tr.json'))),
|
|
261
|
+
'tt': () => Promise.resolve().then(() => __importStar(require('../data/countries/tt.json'))),
|
|
262
|
+
'tv': () => Promise.resolve().then(() => __importStar(require('../data/countries/tv.json'))),
|
|
263
|
+
'tw': () => Promise.resolve().then(() => __importStar(require('../data/countries/tw.json'))),
|
|
264
|
+
'tz': () => Promise.resolve().then(() => __importStar(require('../data/countries/tz.json'))),
|
|
265
|
+
'ua': () => Promise.resolve().then(() => __importStar(require('../data/countries/ua.json'))),
|
|
266
|
+
'ug': () => Promise.resolve().then(() => __importStar(require('../data/countries/ug.json'))),
|
|
267
|
+
'um': () => Promise.resolve().then(() => __importStar(require('../data/countries/um.json'))),
|
|
268
|
+
'us': () => Promise.resolve().then(() => __importStar(require('../data/countries/us.json'))),
|
|
269
|
+
'uy': () => Promise.resolve().then(() => __importStar(require('../data/countries/uy.json'))),
|
|
270
|
+
'uz': () => Promise.resolve().then(() => __importStar(require('../data/countries/uz.json'))),
|
|
271
|
+
'va': () => Promise.resolve().then(() => __importStar(require('../data/countries/va.json'))),
|
|
272
|
+
'vc': () => Promise.resolve().then(() => __importStar(require('../data/countries/vc.json'))),
|
|
273
|
+
've': () => Promise.resolve().then(() => __importStar(require('../data/countries/ve.json'))),
|
|
274
|
+
'vg': () => Promise.resolve().then(() => __importStar(require('../data/countries/vg.json'))),
|
|
275
|
+
'vi': () => Promise.resolve().then(() => __importStar(require('../data/countries/vi.json'))),
|
|
276
|
+
'vn': () => Promise.resolve().then(() => __importStar(require('../data/countries/vn.json'))),
|
|
277
|
+
'vu': () => Promise.resolve().then(() => __importStar(require('../data/countries/vu.json'))),
|
|
278
|
+
'wf': () => Promise.resolve().then(() => __importStar(require('../data/countries/wf.json'))),
|
|
279
|
+
'ws': () => Promise.resolve().then(() => __importStar(require('../data/countries/ws.json'))),
|
|
280
|
+
'xk': () => Promise.resolve().then(() => __importStar(require('../data/countries/xk.json'))),
|
|
281
|
+
'ye': () => Promise.resolve().then(() => __importStar(require('../data/countries/ye.json'))),
|
|
282
|
+
'yt': () => Promise.resolve().then(() => __importStar(require('../data/countries/yt.json'))),
|
|
283
|
+
'za': () => Promise.resolve().then(() => __importStar(require('../data/countries/za.json'))),
|
|
284
|
+
'zm': () => Promise.resolve().then(() => __importStar(require('../data/countries/zm.json'))),
|
|
285
|
+
'zw': () => Promise.resolve().then(() => __importStar(require('../data/countries/zw.json'))),
|
|
286
|
+
};
|
|
287
|
+
exports.default = countryLoaders;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* const country = CountriesAtlas.find('US');
|
|
14
14
|
*/
|
|
15
15
|
export { default as CountriesAtlas } from './helpers/CountriesAtlas';
|
|
16
|
+
export { default as CountriesData, CountriesData as CountriesDataClass } from './helpers/CountriesData';
|
|
16
17
|
export { default as ValidatorAtlas } from './helpers/ValidatorAtlas';
|
|
17
18
|
export type { Country } from './types/country.interface';
|
|
18
19
|
export type { State } from './types/state.interface';
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,8 +17,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.ValidatorAtlas = exports.CountriesAtlas = void 0;
|
|
20
|
+
exports.ValidatorAtlas = exports.CountriesDataClass = exports.CountriesData = exports.CountriesAtlas = void 0;
|
|
21
21
|
var CountriesAtlas_1 = require("./helpers/CountriesAtlas");
|
|
22
22
|
Object.defineProperty(exports, "CountriesAtlas", { enumerable: true, get: function () { return __importDefault(CountriesAtlas_1).default; } });
|
|
23
|
+
// Lightweight country-list helper (no per-country state/city dataset). Prefer
|
|
24
|
+
// importing this — or the `@touchestate/geo-atlas/lite` entry — on paths that
|
|
25
|
+
// only need the country list, to avoid bundling the ~171 MB per-country data.
|
|
26
|
+
var CountriesData_1 = require("./helpers/CountriesData");
|
|
27
|
+
Object.defineProperty(exports, "CountriesData", { enumerable: true, get: function () { return __importDefault(CountriesData_1).default; } });
|
|
28
|
+
Object.defineProperty(exports, "CountriesDataClass", { enumerable: true, get: function () { return CountriesData_1.CountriesData; } });
|
|
23
29
|
var ValidatorAtlas_1 = require("./helpers/ValidatorAtlas");
|
|
24
30
|
Object.defineProperty(exports, "ValidatorAtlas", { enumerable: true, get: function () { return __importDefault(ValidatorAtlas_1).default; } });
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module touchestate/geo-atlas/lite
|
|
4
|
+
*
|
|
5
|
+
* @description Lightweight entry point exposing only the country list and its
|
|
6
|
+
* metadata (names, translations, phone codes, currencies, timezones). Importing
|
|
7
|
+
* from here loads just the small bundled `atlas.json` — it never references the
|
|
8
|
+
* per-country state/city dataset (~171 MB), so it is safe to use on
|
|
9
|
+
* server-rendered / memory-constrained bundling paths.
|
|
10
|
+
*
|
|
11
|
+
* For states/cities, import from `@touchestate/geo-atlas/cities` (loaded on
|
|
12
|
+
* demand, browser/client side) or use the full `CountriesAtlas` from the root
|
|
13
|
+
* entry point.
|
|
14
|
+
*
|
|
15
|
+
* @license MIT
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import CountriesData from '@touchestate/geo-atlas/lite';
|
|
19
|
+
* const countries = CountriesData.getCountries();
|
|
20
|
+
* const country = CountriesData.find('US');
|
|
21
|
+
*/
|
|
22
|
+
export { CountriesData, default } from './helpers/CountriesData';
|
|
23
|
+
export type { Country } from './types/country.interface';
|
|
24
|
+
export type { Timezone } from './types/timezone.type';
|
|
25
|
+
export type { Translations } from './types/translation.type';
|
|
26
|
+
export type { Currency } from './types/currency.type';
|
|
27
|
+
export type { PhoneCode } from './types/phone-code.interface';
|
package/dist/cjs/lite.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
* @module touchestate/geo-atlas/lite
|
|
5
|
+
*
|
|
6
|
+
* @description Lightweight entry point exposing only the country list and its
|
|
7
|
+
* metadata (names, translations, phone codes, currencies, timezones). Importing
|
|
8
|
+
* from here loads just the small bundled `atlas.json` — it never references the
|
|
9
|
+
* per-country state/city dataset (~171 MB), so it is safe to use on
|
|
10
|
+
* server-rendered / memory-constrained bundling paths.
|
|
11
|
+
*
|
|
12
|
+
* For states/cities, import from `@touchestate/geo-atlas/cities` (loaded on
|
|
13
|
+
* demand, browser/client side) or use the full `CountriesAtlas` from the root
|
|
14
|
+
* entry point.
|
|
15
|
+
*
|
|
16
|
+
* @license MIT
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import CountriesData from '@touchestate/geo-atlas/lite';
|
|
20
|
+
* const countries = CountriesData.getCountries();
|
|
21
|
+
* const country = CountriesData.find('US');
|
|
22
|
+
*/
|
|
23
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.default = exports.CountriesData = void 0;
|
|
28
|
+
var CountriesData_1 = require("./helpers/CountriesData");
|
|
29
|
+
Object.defineProperty(exports, "CountriesData", { enumerable: true, get: function () { return CountriesData_1.CountriesData; } });
|
|
30
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(CountriesData_1).default; } });
|
|
@@ -42,5 +42,7 @@ export interface Country {
|
|
|
42
42
|
emojiU?: string;
|
|
43
43
|
/** Legacy code field (same as iso2 in some datasets). */
|
|
44
44
|
code?: string;
|
|
45
|
+
/** Full international phone format placeholder with country code (e.g. "+374 9X XXX XXX"). */
|
|
46
|
+
phone_format?: string;
|
|
45
47
|
[key: string]: any;
|
|
46
48
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { State } from './types/state.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Load the states (with their cities) for a country by ISO2 code.
|
|
4
|
+
*
|
|
5
|
+
* Resolves the per-country data chunk via the code-split `countryLoaders`
|
|
6
|
+
* registry, so only the requested country's JSON is fetched at runtime.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} iso2 - ISO2 code of the country (case-insensitive).
|
|
9
|
+
* @returns {Promise<State[]>} - Promise resolving to the country's states, or an empty array if unavailable.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getStatesForCountry(iso2: string): Promise<State[]>;
|
|
12
|
+
export type { State } from './types/state.interface';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
* @module touchestate/geo-atlas/cities
|
|
13
|
+
*
|
|
14
|
+
* @description On-demand per-country state/city loader. This entry point
|
|
15
|
+
* references `countryLoaders`, which pulls in the per-country JSON dataset
|
|
16
|
+
* (~171 MB across ~250 code-split chunks). Import it only from client/browser
|
|
17
|
+
* paths where the data is actually needed — keep it out of server-rendered
|
|
18
|
+
* bundles by importing it dynamically (e.g. `await import('...cities')`).
|
|
19
|
+
*
|
|
20
|
+
* @license MIT
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const { getStatesForCountry } = await import('@touchestate/geo-atlas/cities');
|
|
24
|
+
* const states = await getStatesForCountry('AM');
|
|
25
|
+
*/
|
|
26
|
+
import countryLoaders from './helpers/countryLoaders';
|
|
27
|
+
/**
|
|
28
|
+
* Load the states (with their cities) for a country by ISO2 code.
|
|
29
|
+
*
|
|
30
|
+
* Resolves the per-country data chunk via the code-split `countryLoaders`
|
|
31
|
+
* registry, so only the requested country's JSON is fetched at runtime.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} iso2 - ISO2 code of the country (case-insensitive).
|
|
34
|
+
* @returns {Promise<State[]>} - Promise resolving to the country's states, or an empty array if unavailable.
|
|
35
|
+
*/
|
|
36
|
+
export function getStatesForCountry(iso2) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const loader = countryLoaders[iso2.toLowerCase()];
|
|
40
|
+
if (!loader)
|
|
41
|
+
return [];
|
|
42
|
+
try {
|
|
43
|
+
const mod = yield loader();
|
|
44
|
+
const data = (_a = mod.default) !== null && _a !== void 0 ? _a : mod;
|
|
45
|
+
return (_b = data.states) !== null && _b !== void 0 ? _b : [];
|
|
46
|
+
}
|
|
47
|
+
catch (_c) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|