@mailwoman/codex 9.1.0 → 9.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 +48 -5
- package/ca/index.ts +1 -1
- package/ca/postal-code.ts +11 -11
- package/country/display-names.ts +150 -0
- package/country/index.ts +2 -0
- package/country/population.ts +265 -0
- package/country/subdivision.ts +59 -0
- package/de/index.ts +1 -1
- package/de/postleitzahl.ts +3 -3
- package/es/codigo-postal.ts +2 -2
- package/fr/code-postal.ts +6 -6
- package/fr/index.ts +1 -1
- package/index.ts +10 -1
- package/it/cap.ts +2 -2
- package/jp/index.ts +1 -1
- package/jp/postal-code.ts +11 -11
- package/out/ca/index.d.ts +1 -1
- package/out/ca/index.js +1 -1
- package/out/ca/postal-code.d.ts +10 -10
- package/out/ca/postal-code.js +9 -9
- package/out/country/display-names.d.ts +67 -0
- package/out/country/display-names.d.ts.map +1 -0
- package/out/country/display-names.js +118 -0
- package/out/country/display-names.js.map +1 -0
- package/out/country/index.d.ts +2 -0
- package/out/country/index.d.ts.map +1 -1
- package/out/country/index.js +2 -0
- package/out/country/index.js.map +1 -1
- package/out/country/population.d.ts +16 -0
- package/out/country/population.d.ts.map +1 -0
- package/out/country/population.js +265 -0
- package/out/country/population.js.map +1 -0
- package/out/country/subdivision.d.ts +7 -0
- package/out/country/subdivision.d.ts.map +1 -1
- package/out/country/subdivision.js +49 -0
- package/out/country/subdivision.js.map +1 -1
- package/out/de/index.d.ts +1 -1
- package/out/de/index.js +1 -1
- package/out/de/postleitzahl.d.ts +3 -3
- package/out/de/postleitzahl.js +2 -2
- package/out/es/codigo-postal.d.ts +2 -2
- package/out/es/codigo-postal.js +1 -1
- package/out/fr/code-postal.d.ts +5 -5
- package/out/fr/code-postal.js +6 -6
- package/out/fr/index.d.ts +1 -1
- package/out/fr/index.js +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/index.js.map +1 -1
- package/out/it/cap.d.ts +2 -2
- package/out/it/cap.js +1 -1
- package/out/jp/index.d.ts +1 -1
- package/out/jp/index.js +1 -1
- package/out/jp/postal-code.d.ts +11 -11
- package/out/jp/postal-code.js +8 -8
- package/out/postcode-systems.d.ts +84 -0
- package/out/postcode-systems.d.ts.map +1 -1
- package/out/postcode-systems.js +106 -0
- package/out/postcode-systems.js.map +1 -1
- package/out/tools/build-country-surface-lexicon.js +1 -1
- package/out/tools/build-country-surface-lexicon.js.map +1 -1
- package/out/tools/export-country-surfaces.js +1 -1
- package/out/tools/export-country-surfaces.js.map +1 -1
- package/out/tools/generate-country-population.d.ts +42 -0
- package/out/tools/generate-country-population.d.ts.map +1 -0
- package/out/tools/generate-country-population.js +106 -0
- package/out/tools/generate-country-population.js.map +1 -0
- package/out/tools/generate-country-reference.d.ts.map +1 -1
- package/out/tools/generate-country-reference.js +4 -4
- package/out/tools/generate-country-reference.js.map +1 -1
- package/out/tools/generate-official-languages.d.ts.map +1 -1
- package/out/tools/generate-official-languages.js +7 -4
- package/out/tools/generate-official-languages.js.map +1 -1
- package/out/tools/index.d.ts +2 -2
- package/out/tools/index.d.ts.map +1 -1
- package/out/tools/index.js +2 -2
- package/out/tools/index.js.map +1 -1
- package/out/us/zipcode.d.ts +1 -1
- package/out/us/zipcode.js +1 -1
- package/package.json +326 -4
- package/postcode-systems.ts +112 -0
- package/tools/build-country-surface-lexicon.ts +1 -1
- package/tools/export-country-surfaces.ts +1 -1
- package/tools/generate-country-population.ts +143 -0
- package/tools/generate-country-reference.ts +5 -3
- package/tools/generate-official-languages.ts +8 -4
- package/tools/index.ts +2 -2
- package/us/zipcode.ts +1 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* GENERATED — do not edit by hand. Per-country population, derived from GeoNames countryInfo.txt
|
|
7
|
+
* (https://download.geonames.org/export/dump/countryInfo.txt, CC-BY-4.0). Estimates are
|
|
8
|
+
* census-vintage; a prominence race reads the magnitude, not the currency. Countries GeoNames
|
|
9
|
+
* declines to estimate are ABSENT, never zero.
|
|
10
|
+
* Regenerate with: mailwoman dev generate country-population
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* ISO 3166-1 alpha-2 → population estimate.
|
|
14
|
+
*/
|
|
15
|
+
export const COUNTRY_POPULATION = {
|
|
16
|
+
AD: 77_006,
|
|
17
|
+
AE: 9_630_959,
|
|
18
|
+
AF: 37_172_386,
|
|
19
|
+
AG: 96_286,
|
|
20
|
+
AI: 13_254,
|
|
21
|
+
AL: 2_866_376,
|
|
22
|
+
AM: 3_090_500,
|
|
23
|
+
AN: 300_000,
|
|
24
|
+
AO: 30_809_762,
|
|
25
|
+
AR: 44_494_502,
|
|
26
|
+
AS: 55_465,
|
|
27
|
+
AT: 8_847_037,
|
|
28
|
+
AU: 24_992_369,
|
|
29
|
+
AW: 105_845,
|
|
30
|
+
AX: 26_711,
|
|
31
|
+
AZ: 10_224_900,
|
|
32
|
+
BA: 3_323_929,
|
|
33
|
+
BB: 286_641,
|
|
34
|
+
BD: 161_356_039,
|
|
35
|
+
BE: 11_422_068,
|
|
36
|
+
BF: 19_751_535,
|
|
37
|
+
BG: 7_000_039,
|
|
38
|
+
BH: 1_569_439,
|
|
39
|
+
BI: 11_175_378,
|
|
40
|
+
BJ: 11_485_048,
|
|
41
|
+
BL: 8450,
|
|
42
|
+
BM: 63_968,
|
|
43
|
+
BN: 428_962,
|
|
44
|
+
BO: 11_353_142,
|
|
45
|
+
BQ: 18_012,
|
|
46
|
+
BR: 209_469_333,
|
|
47
|
+
BS: 385_640,
|
|
48
|
+
BT: 754_394,
|
|
49
|
+
BW: 2_254_126,
|
|
50
|
+
BY: 9_485_386,
|
|
51
|
+
BZ: 383_071,
|
|
52
|
+
CA: 37_058_856,
|
|
53
|
+
CC: 628,
|
|
54
|
+
CD: 84_068_091,
|
|
55
|
+
CF: 4_666_377,
|
|
56
|
+
CG: 5_244_363,
|
|
57
|
+
CH: 8_516_543,
|
|
58
|
+
CI: 25_069_229,
|
|
59
|
+
CK: 21_388,
|
|
60
|
+
CL: 18_729_160,
|
|
61
|
+
CM: 25_216_237,
|
|
62
|
+
CN: 1_411_778_724,
|
|
63
|
+
CO: 49_648_685,
|
|
64
|
+
CR: 4_999_441,
|
|
65
|
+
CS: 10_829_175,
|
|
66
|
+
CU: 11_338_138,
|
|
67
|
+
CV: 543_767,
|
|
68
|
+
CW: 159_849,
|
|
69
|
+
CX: 1500,
|
|
70
|
+
CY: 1_189_265,
|
|
71
|
+
CZ: 10_625_695,
|
|
72
|
+
DE: 82_927_922,
|
|
73
|
+
DJ: 958_920,
|
|
74
|
+
DK: 5_797_446,
|
|
75
|
+
DM: 71_625,
|
|
76
|
+
DO: 10_627_165,
|
|
77
|
+
DZ: 42_228_429,
|
|
78
|
+
EC: 17_084_357,
|
|
79
|
+
EE: 1_320_884,
|
|
80
|
+
EG: 98_423_595,
|
|
81
|
+
EH: 273_008,
|
|
82
|
+
ER: 6_209_262,
|
|
83
|
+
ES: 46_723_749,
|
|
84
|
+
ET: 109_224_559,
|
|
85
|
+
FI: 5_518_050,
|
|
86
|
+
FJ: 883_483,
|
|
87
|
+
FK: 2638,
|
|
88
|
+
FM: 112_640,
|
|
89
|
+
FO: 48_497,
|
|
90
|
+
FR: 66_987_244,
|
|
91
|
+
GA: 2_119_275,
|
|
92
|
+
GB: 66_488_991,
|
|
93
|
+
GD: 111_454,
|
|
94
|
+
GE: 3_704_500,
|
|
95
|
+
GF: 195_506,
|
|
96
|
+
GG: 65_228,
|
|
97
|
+
GH: 29_767_108,
|
|
98
|
+
GI: 33_718,
|
|
99
|
+
GL: 56_025,
|
|
100
|
+
GM: 2_280_102,
|
|
101
|
+
GN: 12_414_318,
|
|
102
|
+
GP: 443_000,
|
|
103
|
+
GQ: 1_308_974,
|
|
104
|
+
GR: 10_727_668,
|
|
105
|
+
GS: 30,
|
|
106
|
+
GT: 17_247_807,
|
|
107
|
+
GU: 165_768,
|
|
108
|
+
GW: 1_874_309,
|
|
109
|
+
GY: 779_004,
|
|
110
|
+
HK: 7_396_076,
|
|
111
|
+
HN: 9_587_522,
|
|
112
|
+
HR: 3_871_833,
|
|
113
|
+
HT: 11_123_176,
|
|
114
|
+
HU: 9_768_785,
|
|
115
|
+
ID: 267_663_435,
|
|
116
|
+
IE: 4_853_506,
|
|
117
|
+
IL: 8_883_800,
|
|
118
|
+
IM: 84_077,
|
|
119
|
+
IN: 1_352_617_328,
|
|
120
|
+
IO: 4000,
|
|
121
|
+
IQ: 38_433_600,
|
|
122
|
+
IR: 81_800_269,
|
|
123
|
+
IS: 353_574,
|
|
124
|
+
IT: 60_431_283,
|
|
125
|
+
JE: 90_812,
|
|
126
|
+
JM: 2_934_855,
|
|
127
|
+
JO: 9_956_011,
|
|
128
|
+
JP: 126_529_100,
|
|
129
|
+
KE: 51_393_010,
|
|
130
|
+
KG: 6_315_800,
|
|
131
|
+
KH: 16_249_798,
|
|
132
|
+
KI: 115_847,
|
|
133
|
+
KM: 832_322,
|
|
134
|
+
KN: 52_441,
|
|
135
|
+
KP: 25_549_819,
|
|
136
|
+
KR: 51_635_256,
|
|
137
|
+
KW: 4_137_309,
|
|
138
|
+
KY: 64_174,
|
|
139
|
+
KZ: 18_276_499,
|
|
140
|
+
LA: 7_061_507,
|
|
141
|
+
LB: 6_848_925,
|
|
142
|
+
LC: 181_889,
|
|
143
|
+
LI: 37_910,
|
|
144
|
+
LK: 21_670_000,
|
|
145
|
+
LR: 4_818_977,
|
|
146
|
+
LS: 2_108_132,
|
|
147
|
+
LT: 2_789_533,
|
|
148
|
+
LU: 607_728,
|
|
149
|
+
LV: 1_926_542,
|
|
150
|
+
LY: 6_678_567,
|
|
151
|
+
MA: 36_029_138,
|
|
152
|
+
MC: 38_682,
|
|
153
|
+
MD: 3_545_883,
|
|
154
|
+
ME: 622_345,
|
|
155
|
+
MF: 37_264,
|
|
156
|
+
MG: 26_262_368,
|
|
157
|
+
MH: 58_413,
|
|
158
|
+
MK: 2_082_958,
|
|
159
|
+
ML: 19_077_690,
|
|
160
|
+
MM: 53_708_395,
|
|
161
|
+
MN: 3_170_208,
|
|
162
|
+
MO: 631_636,
|
|
163
|
+
MP: 56_882,
|
|
164
|
+
MQ: 432_900,
|
|
165
|
+
MR: 4_403_319,
|
|
166
|
+
MS: 9341,
|
|
167
|
+
MT: 483_530,
|
|
168
|
+
MU: 1_265_303,
|
|
169
|
+
MV: 515_696,
|
|
170
|
+
MW: 17_563_749,
|
|
171
|
+
MX: 126_190_788,
|
|
172
|
+
MY: 31_528_585,
|
|
173
|
+
MZ: 29_495_962,
|
|
174
|
+
NA: 2_448_255,
|
|
175
|
+
NC: 284_060,
|
|
176
|
+
NE: 22_442_948,
|
|
177
|
+
NF: 1828,
|
|
178
|
+
NG: 195_874_740,
|
|
179
|
+
NI: 6_465_513,
|
|
180
|
+
NL: 17_231_017,
|
|
181
|
+
NO: 5_314_336,
|
|
182
|
+
NP: 28_087_871,
|
|
183
|
+
NR: 12_704,
|
|
184
|
+
NU: 2166,
|
|
185
|
+
NZ: 4_885_500,
|
|
186
|
+
OM: 4_829_483,
|
|
187
|
+
PA: 4_176_873,
|
|
188
|
+
PE: 31_989_256,
|
|
189
|
+
PF: 277_679,
|
|
190
|
+
PG: 8_606_316,
|
|
191
|
+
PH: 106_651_922,
|
|
192
|
+
PK: 212_215_030,
|
|
193
|
+
PL: 37_978_548,
|
|
194
|
+
PM: 7012,
|
|
195
|
+
PN: 46,
|
|
196
|
+
PR: 3_195_153,
|
|
197
|
+
PS: 4_569_087,
|
|
198
|
+
PT: 10_281_762,
|
|
199
|
+
PW: 17_907,
|
|
200
|
+
PY: 6_956_071,
|
|
201
|
+
QA: 2_781_677,
|
|
202
|
+
RE: 776_948,
|
|
203
|
+
RO: 19_473_936,
|
|
204
|
+
RS: 6_982_084,
|
|
205
|
+
RU: 144_478_050,
|
|
206
|
+
RW: 12_301_939,
|
|
207
|
+
SA: 33_699_947,
|
|
208
|
+
SB: 652_858,
|
|
209
|
+
SC: 96_762,
|
|
210
|
+
SD: 41_801_533,
|
|
211
|
+
SE: 10_183_175,
|
|
212
|
+
SG: 5_638_676,
|
|
213
|
+
SH: 7460,
|
|
214
|
+
SI: 2_067_372,
|
|
215
|
+
SJ: 2550,
|
|
216
|
+
SK: 5_447_011,
|
|
217
|
+
SL: 7_650_154,
|
|
218
|
+
SM: 33_785,
|
|
219
|
+
SN: 15_854_360,
|
|
220
|
+
SO: 15_008_154,
|
|
221
|
+
SR: 575_991,
|
|
222
|
+
SS: 8_260_490,
|
|
223
|
+
ST: 197_700,
|
|
224
|
+
SV: 6_420_744,
|
|
225
|
+
SX: 40_654,
|
|
226
|
+
SY: 16_906_283,
|
|
227
|
+
SZ: 1_136_191,
|
|
228
|
+
TC: 37_665,
|
|
229
|
+
TD: 15_477_751,
|
|
230
|
+
TF: 140,
|
|
231
|
+
TG: 7_889_094,
|
|
232
|
+
TH: 69_428_524,
|
|
233
|
+
TJ: 9_100_837,
|
|
234
|
+
TK: 1466,
|
|
235
|
+
TL: 1_267_972,
|
|
236
|
+
TM: 5_850_908,
|
|
237
|
+
TN: 11_565_204,
|
|
238
|
+
TO: 103_197,
|
|
239
|
+
TR: 82_319_724,
|
|
240
|
+
TT: 1_389_858,
|
|
241
|
+
TV: 11_508,
|
|
242
|
+
TW: 23_451_837,
|
|
243
|
+
TZ: 56_318_348,
|
|
244
|
+
UA: 40_000_000,
|
|
245
|
+
UG: 42_723_139,
|
|
246
|
+
US: 327_167_434,
|
|
247
|
+
UY: 3_449_299,
|
|
248
|
+
UZ: 32_955_400,
|
|
249
|
+
VA: 921,
|
|
250
|
+
VC: 110_211,
|
|
251
|
+
VE: 28_870_195,
|
|
252
|
+
VG: 29_802,
|
|
253
|
+
VI: 106_977,
|
|
254
|
+
VN: 95_540_395,
|
|
255
|
+
VU: 292_680,
|
|
256
|
+
WF: 16_025,
|
|
257
|
+
WS: 196_130,
|
|
258
|
+
XK: 1_845_300,
|
|
259
|
+
YE: 28_498_687,
|
|
260
|
+
YT: 279_471,
|
|
261
|
+
ZA: 57_779_622,
|
|
262
|
+
ZM: 17_351_822,
|
|
263
|
+
ZW: 16_868_409,
|
|
264
|
+
};
|
|
265
|
+
//# sourceMappingURL=population.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"population.js","sourceRoot":"","sources":["../../country/population.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAqC;IACnE,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,UAAU;IACd,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,E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* those).
|
|
50
50
|
*/
|
|
51
51
|
export declare function matchSubdivision(token: string | null | undefined): SubdivisionMatch | null;
|
|
52
|
+
/**
|
|
53
|
+
* Resolve a subdivision surface form WITHIN one country. Same folding and return shape as {@link matchSubdivision}, but
|
|
54
|
+
* scoped: `WA` under `AU` is Western Australia, under `US` Washington, and under any other country null. Use this
|
|
55
|
+
* whenever the country is already established; the unscoped lookup exists for the address-line case where the
|
|
56
|
+
* subdivision itself is the country evidence.
|
|
57
|
+
*/
|
|
58
|
+
export declare function matchSubdivisionIn(countryAlpha2: string, token: string | null | undefined): SubdivisionMatch | null;
|
|
52
59
|
//# sourceMappingURL=subdivision.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subdivision.d.ts","sourceRoot":"","sources":["../../country/subdivision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"subdivision.d.ts","sourceRoot":"","sources":["../../country/subdivision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;CACf;AAkCD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,GAAG,IAAI,CAI1F;AAgDD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,GAAG,IAAI,CAInH"}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* `CA_PROVINCES` (ISO 3166-2:CA) tables. No new provenance is introduced here — this module only
|
|
26
26
|
* re-keys those two existing tables into one subdivision→country view.
|
|
27
27
|
*/
|
|
28
|
+
import { AU_STATE_ABBREVIATIONS } from "../au/state.js";
|
|
28
29
|
import { CA_PROVINCES } from "../ca/province.js";
|
|
29
30
|
import { foldName } from "../normalize.js";
|
|
30
31
|
import { US_STATE_BY_ABBREVIATION } from "../us/state.js";
|
|
@@ -65,4 +66,52 @@ export function matchSubdivision(token) {
|
|
|
65
66
|
return null;
|
|
66
67
|
return SUBDIVISION_LOOKUP.get(foldName(token)) ?? null;
|
|
67
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Per-country subdivision lookups for callers that already KNOW the country. Kept separate from
|
|
71
|
+
* {@link SUBDIVISION_LOOKUP} on purpose: the combined map is only unambiguous because the US and CA sets are disjoint,
|
|
72
|
+
* and Australia breaks that property twice — `WA` collides with Washington and `NT` with the Northwest Territories. A
|
|
73
|
+
* country-scoped caller (the admin-coherence check reads the winner's resolver-stamped country) dissolves the collision
|
|
74
|
+
* instead of arbitrating it.
|
|
75
|
+
*/
|
|
76
|
+
const SCOPED_SUBDIVISION_LOOKUP = (() => {
|
|
77
|
+
const byCountry = new Map();
|
|
78
|
+
const put = (country, key, match) => {
|
|
79
|
+
const folded = foldName(key);
|
|
80
|
+
if (!folded.length)
|
|
81
|
+
return;
|
|
82
|
+
const scoped = byCountry.get(country) ?? new Map();
|
|
83
|
+
byCountry.set(country, scoped);
|
|
84
|
+
if (!scoped.has(folded)) {
|
|
85
|
+
scoped.set(folded, match);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
for (const [code, name] of Object.entries(US_STATE_BY_ABBREVIATION)) {
|
|
89
|
+
const match = { code, name, country: "US" };
|
|
90
|
+
put("US", code, match);
|
|
91
|
+
put("US", name, match);
|
|
92
|
+
}
|
|
93
|
+
for (const info of Object.values(CA_PROVINCES)) {
|
|
94
|
+
const match = { code: info.code, name: info.name, country: "CA" };
|
|
95
|
+
put("CA", info.code, match);
|
|
96
|
+
put("CA", info.name, match);
|
|
97
|
+
put("CA", info.french, match);
|
|
98
|
+
}
|
|
99
|
+
for (const [code, name] of Object.entries(AU_STATE_ABBREVIATIONS)) {
|
|
100
|
+
const match = { code, name, country: "AU" };
|
|
101
|
+
put("AU", code, match);
|
|
102
|
+
put("AU", name, match);
|
|
103
|
+
}
|
|
104
|
+
return byCountry;
|
|
105
|
+
})();
|
|
106
|
+
/**
|
|
107
|
+
* Resolve a subdivision surface form WITHIN one country. Same folding and return shape as {@link matchSubdivision}, but
|
|
108
|
+
* scoped: `WA` under `AU` is Western Australia, under `US` Washington, and under any other country null. Use this
|
|
109
|
+
* whenever the country is already established; the unscoped lookup exists for the address-line case where the
|
|
110
|
+
* subdivision itself is the country evidence.
|
|
111
|
+
*/
|
|
112
|
+
export function matchSubdivisionIn(countryAlpha2, token) {
|
|
113
|
+
if (!token || typeof token !== "string")
|
|
114
|
+
return null;
|
|
115
|
+
return SCOPED_SUBDIVISION_LOOKUP.get(countryAlpha2.toUpperCase())?.get(foldName(token)) ?? null;
|
|
116
|
+
}
|
|
68
117
|
//# sourceMappingURL=subdivision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subdivision.js","sourceRoot":"","sources":["../../country/subdivision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAoBzD;;;;GAIG;AACH,MAAM,kBAAkB,GAA0C,CAAC,GAAG,EAAE;IACvE,MAAM,GAAG,GAAG,IAAI,GAAG,EAA4B,CAAA;IAE/C,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,KAAuB,EAAQ,EAAE;QAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;QAE5B,IAAI,MAAM,CAAC,MA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/de/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The German address system (Deutsche Post / ISO 3166-2:DE): street types,
|
|
6
|
+
* The German address system (Deutsche Post / ISO 3166-2:DE): street types, postcodes
|
|
7
7
|
* (Postleitzahl), and the federal states (Bundesländer).
|
|
8
8
|
*/
|
|
9
9
|
export * from "./bundesland.ts";
|
package/out/de/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The German address system (Deutsche Post / ISO 3166-2:DE): street types,
|
|
6
|
+
* The German address system (Deutsche Post / ISO 3166-2:DE): street types, postcodes
|
|
7
7
|
* (Postleitzahl), and the federal states (Bundesländer).
|
|
8
8
|
*/
|
|
9
9
|
export * from "./bundesland.js";
|
package/out/de/postleitzahl.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* German
|
|
6
|
+
* German postcodes (Postleitzahl, PLZ): the branded type, the shape, normalization, and the
|
|
7
7
|
* first-digit → Leitzone geographic prior.
|
|
8
8
|
*
|
|
9
9
|
* The US analog is `us/zipcode.ts`, and the contrast is the informative part. A US ZIP's first
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import type { Tagged } from "type-fest";
|
|
18
18
|
/**
|
|
19
|
-
* A German
|
|
19
|
+
* A German postcode: five digits since the 1993 reform (`12623`). A bare 5-digit string, same shape as a US ZIP or a
|
|
20
20
|
* French code postal — disambiguation is the parser's job, not the shape's.
|
|
21
21
|
*
|
|
22
22
|
* @category Postal
|
|
@@ -35,7 +35,7 @@ export declare const PLZ_PATTERN: RegExp;
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function normalizePLZ(raw: unknown): Postleitzahl | null;
|
|
37
37
|
/**
|
|
38
|
-
* Type-predicate for a (normalized) German
|
|
38
|
+
* Type-predicate for a (normalized) German postcode.
|
|
39
39
|
*/
|
|
40
40
|
export declare function isPostleitzahl(input: unknown): input is Postleitzahl;
|
|
41
41
|
/**
|
package/out/de/postleitzahl.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* German
|
|
6
|
+
* German postcodes (Postleitzahl, PLZ): the branded type, the shape, normalization, and the
|
|
7
7
|
* first-digit → Leitzone geographic prior.
|
|
8
8
|
*
|
|
9
9
|
* The US analog is `us/zipcode.ts`, and the contrast is the informative part. A US ZIP's first
|
|
@@ -29,7 +29,7 @@ export function normalizePLZ(raw) {
|
|
|
29
29
|
return PLZ_PATTERN.test(s) ? s : null;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Type-predicate for a (normalized) German
|
|
32
|
+
* Type-predicate for a (normalized) German postcode.
|
|
33
33
|
*/
|
|
34
34
|
export function isPostleitzahl(input) {
|
|
35
35
|
return typeof input === "string" && PLZ_PATTERN.test(input);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Spanish
|
|
6
|
+
* Spanish postcodes (código postal): the branded type, the shape, and the province prior.
|
|
7
7
|
*
|
|
8
8
|
* The contrast with a German PLZ is the informative part. A PLZ's leading digit maps to a Leitzone
|
|
9
9
|
* that deliberately CROSSES state borders, so it cannot tell you the Bundesland. A Spanish código
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { Tagged } from "type-fest";
|
|
16
16
|
/**
|
|
17
|
-
* A Spanish
|
|
17
|
+
* A Spanish postcode: five digits, `PPNNN`, where `PP` is the province (`28001` is Madrid).
|
|
18
18
|
*
|
|
19
19
|
* @category Postal
|
|
20
20
|
* @type string
|
package/out/es/codigo-postal.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Spanish
|
|
6
|
+
* Spanish postcodes (código postal): the branded type, the shape, and the province prior.
|
|
7
7
|
*
|
|
8
8
|
* The contrast with a German PLZ is the informative part. A PLZ's leading digit maps to a Leitzone
|
|
9
9
|
* that deliberately CROSSES state borders, so it cannot tell you the Bundesland. A Spanish código
|
package/out/fr/code-postal.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* French
|
|
6
|
+
* French postcodes (code postal): the branded type, the shape, normalization, and the
|
|
7
7
|
* first-two-digits → département mapping — the cleanest postcode→admin prior of the three
|
|
8
8
|
* systems.
|
|
9
9
|
*
|
|
@@ -37,11 +37,11 @@ export declare const CODE_POSTAL_PATTERN: RegExp;
|
|
|
37
37
|
*/
|
|
38
38
|
export declare function normalizeCodePostal(raw: unknown): CodePostal | null;
|
|
39
39
|
/**
|
|
40
|
-
* Type-predicate for a (normalized) French
|
|
40
|
+
* Type-predicate for a (normalized) French postcode.
|
|
41
41
|
*/
|
|
42
42
|
export declare function isCodePostal(input: unknown): input is CodePostal;
|
|
43
43
|
/**
|
|
44
|
-
* The département code a
|
|
44
|
+
* The département code a postcode belongs to. The clean rule plus its two exceptions:
|
|
45
45
|
*
|
|
46
46
|
* - `20xxx` → Corsica. The split is by the rest of the code: roughly `20000`–`20199` → `2A` (Ajaccio side), `20200`+ →
|
|
47
47
|
* `2B` (Bastia side). Approximate at the boundary, exact for the bulk.
|
|
@@ -52,11 +52,11 @@ export declare function isCodePostal(input: unknown): input is CodePostal;
|
|
|
52
52
|
*/
|
|
53
53
|
export declare function departementOfCodePostal(codePostal: unknown): DepartementCode | null;
|
|
54
54
|
/**
|
|
55
|
-
* The full département record a
|
|
55
|
+
* The full département record a postcode resolves to (name + région), or null.
|
|
56
56
|
*/
|
|
57
57
|
export declare function departementForCodePostal(codePostal: unknown): DepartementInfo | null;
|
|
58
58
|
/**
|
|
59
|
-
* The région a
|
|
59
|
+
* The région a postcode resolves to, via its département; null if the code maps to no département.
|
|
60
60
|
*/
|
|
61
61
|
export declare function regionForCodePostal(codePostal: unknown): FrenchRegionInfo | null;
|
|
62
62
|
//# sourceMappingURL=code-postal.d.ts.map
|
package/out/fr/code-postal.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* French
|
|
6
|
+
* French postcodes (code postal): the branded type, the shape, normalization, and the
|
|
7
7
|
* first-two-digits → département mapping — the cleanest postcode→admin prior of the three
|
|
8
8
|
* systems.
|
|
9
9
|
*
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import { departementInfo } from "./departement.js";
|
|
27
27
|
import { FR_REGIONS } from "./region.js";
|
|
28
28
|
/**
|
|
29
|
-
* A French
|
|
29
|
+
* A French postcode: five digits (`75008`). Same shape as a US ZIP or a German PLZ — the shape alone does not
|
|
30
30
|
* disambiguate the country.
|
|
31
31
|
*
|
|
32
32
|
* @category Postal
|
|
@@ -54,13 +54,13 @@ export function normalizeCodePostal(raw) {
|
|
|
54
54
|
return CODE_POSTAL_PATTERN.test(s) ? s : null;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Type-predicate for a (normalized) French
|
|
57
|
+
* Type-predicate for a (normalized) French postcode.
|
|
58
58
|
*/
|
|
59
59
|
export function isCodePostal(input) {
|
|
60
60
|
return typeof input === "string" && CODE_POSTAL_PATTERN.test(input);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* The département code a
|
|
63
|
+
* The département code a postcode belongs to. The clean rule plus its two exceptions:
|
|
64
64
|
*
|
|
65
65
|
* - `20xxx` → Corsica. The split is by the rest of the code: roughly `20000`–`20199` → `2A` (Ajaccio side), `20200`+ →
|
|
66
66
|
* `2B` (Bastia side). Approximate at the boundary, exact for the bulk.
|
|
@@ -86,13 +86,13 @@ export function departementOfCodePostal(codePostal) {
|
|
|
86
86
|
return departementInfo(dd) ? dd : null;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
* The full département record a
|
|
89
|
+
* The full département record a postcode resolves to (name + région), or null.
|
|
90
90
|
*/
|
|
91
91
|
export function departementForCodePostal(codePostal) {
|
|
92
92
|
return departementInfo(departementOfCodePostal(codePostal));
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* The région a
|
|
95
|
+
* The région a postcode resolves to, via its département; null if the code maps to no département.
|
|
96
96
|
*/
|
|
97
97
|
export function regionForCodePostal(codePostal) {
|
|
98
98
|
const dep = departementForCodePostal(codePostal);
|
package/out/fr/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The French address system (La Poste / ISO 3166-2:FR): street types (voie),
|
|
6
|
+
* The French address system (La Poste / ISO 3166-2:FR): street types (voie), postcodes (code
|
|
7
7
|
* postal), and the admin hierarchy of départements and régions.
|
|
8
8
|
*/
|
|
9
9
|
export * from "./cedex.ts";
|
package/out/fr/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The French address system (La Poste / ISO 3166-2:FR): street types (voie),
|
|
6
|
+
* The French address system (La Poste / ISO 3166-2:FR): street types (voie), postcodes (code
|
|
7
7
|
* postal), and the admin hierarchy of départements and régions.
|
|
8
8
|
*/
|
|
9
9
|
export * from "./cedex.js";
|
package/out/index.d.ts
CHANGED
|
@@ -30,6 +30,6 @@ export * as gb from "./gb/index.ts";
|
|
|
30
30
|
export * as jp from "./jp/index.ts";
|
|
31
31
|
export * as levels from "./level-semantics.ts";
|
|
32
32
|
export * as nz from "./nz/index.ts";
|
|
33
|
-
export { candidateSystemsForPostcode, type SystemCode } from "./postcode-systems.ts";
|
|
33
|
+
export { AREA_POSTCODE_FINER_THAN_LOCALITY, areaPostcodeLeadsLocality, candidateSystemsForPostcode, isUnitGradePostcodeHit, type SystemCode, UNIT_GRADE_POSTCODE, } from "./postcode-systems.ts";
|
|
34
34
|
export * as us from "./us/index.ts";
|
|
35
35
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACN,0BAA0B,EAC1B,oBAAoB,EACpB,KAAK,wBAAwB,GAC7B,MAAM,iCAAiC,CAAA;AAExC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACN,0BAA0B,EAC1B,oBAAoB,EACpB,KAAK,wBAAwB,GAC7B,MAAM,iCAAiC,CAAA;AAExC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AAEnC,OAAO,EACN,iCAAiC,EACjC,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,KAAK,UAAU,EACf,mBAAmB,GACnB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -30,6 +30,6 @@ export * as gb from "./gb/index.js";
|
|
|
30
30
|
export * as jp from "./jp/index.js";
|
|
31
31
|
export * as levels from "./level-semantics.js";
|
|
32
32
|
export * as nz from "./nz/index.js";
|
|
33
|
-
export { candidateSystemsForPostcode } from "./postcode-systems.js";
|
|
33
|
+
export { AREA_POSTCODE_FINER_THAN_LOCALITY, areaPostcodeLeadsLocality, candidateSystemsForPostcode, isUnitGradePostcodeHit, UNIT_GRADE_POSTCODE, } from "./postcode-systems.js";
|
|
34
34
|
export * as us from "./us/index.js";
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACN,0BAA0B,EAC1B,oBAAoB,GAEpB,MAAM,iCAAiC,CAAA;AAExC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACN,0BAA0B,EAC1B,oBAAoB,GAEpB,MAAM,iCAAiC,CAAA;AAExC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA;AAEnC,OAAO,EACN,iCAAiC,EACjC,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EAEtB,mBAAmB,GACnB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA"}
|
package/out/it/cap.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Italian
|
|
6
|
+
* Italian postcodes (Codice di Avviamento Postale, CAP): the branded type and the shape.
|
|
7
7
|
*
|
|
8
8
|
* Five digits like the Spanish, French and German forms, but do NOT infer a province from the
|
|
9
9
|
* leading digits the way `es/codigo-postal.ts` documents for Spain. Italy's large cities are
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { Tagged } from "type-fest";
|
|
15
15
|
/**
|
|
16
|
-
* An Italian
|
|
16
|
+
* An Italian postcode: five digits (`00184` is Rome, Rione Monti).
|
|
17
17
|
*
|
|
18
18
|
* @category Postal
|
|
19
19
|
* @type string
|
package/out/it/cap.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Italian
|
|
6
|
+
* Italian postcodes (Codice di Avviamento Postale, CAP): the branded type and the shape.
|
|
7
7
|
*
|
|
8
8
|
* Five digits like the Spanish, French and German forms, but do NOT infer a province from the
|
|
9
9
|
* leading digits the way `es/codigo-postal.ts` documents for Spain. Italy's large cities are
|
package/out/jp/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The Japanese address system (Japan Post / ISO 3166-2:JP): the 47 prefectures, the
|
|
6
|
+
* The Japanese address system (Japan Post / ISO 3166-2:JP): the 47 prefectures, the postcode
|
|
7
7
|
* that is the country's most reliable geographic anchor, and the address-unit markers that stand
|
|
8
8
|
* in for the street names Japan does not use.
|
|
9
9
|
*/
|
package/out/jp/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The Japanese address system (Japan Post / ISO 3166-2:JP): the 47 prefectures, the
|
|
6
|
+
* The Japanese address system (Japan Post / ISO 3166-2:JP): the 47 prefectures, the postcode
|
|
7
7
|
* that is the country's most reliable geographic anchor, and the address-unit markers that stand
|
|
8
8
|
* in for the street names Japan does not use.
|
|
9
9
|
*/
|