@mailwoman/codex 8.5.0 → 9.0.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 +1 -1
- package/ca/province.ts +2 -12
- package/country/subdivision.ts +1 -12
- package/es/codigo-postal.ts +51 -0
- package/es/index.ts +9 -0
- package/fr/region.ts +2 -12
- package/gb/postcode-area.ts +10 -0
- package/index.ts +1 -0
- package/it/cap.ts +39 -0
- package/it/index.ts +9 -0
- package/normalize.ts +53 -0
- package/nz/delivery-service.ts +17 -17
- package/nz/postcode.ts +4 -4
- package/out/ca/province.d.ts.map +1 -1
- package/out/ca/province.js +1 -11
- package/out/ca/province.js.map +1 -1
- package/out/country/subdivision.d.ts.map +1 -1
- package/out/country/subdivision.js +1 -11
- package/out/country/subdivision.js.map +1 -1
- package/out/es/codigo-postal.d.ts +39 -0
- package/out/es/codigo-postal.d.ts.map +1 -0
- package/out/es/codigo-postal.js +35 -0
- package/out/es/codigo-postal.js.map +1 -0
- package/out/es/index.d.ts +9 -0
- package/out/es/index.d.ts.map +1 -0
- package/out/es/index.js +9 -0
- package/out/es/index.js.map +1 -0
- package/out/fr/region.d.ts.map +1 -1
- package/out/fr/region.js +1 -11
- package/out/fr/region.js.map +1 -1
- package/out/gb/postcode-area.d.ts +9 -0
- package/out/gb/postcode-area.d.ts.map +1 -1
- package/out/gb/postcode-area.js +9 -0
- package/out/gb/postcode-area.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/it/cap.d.ts +32 -0
- package/out/it/cap.d.ts.map +1 -0
- package/out/it/cap.js +25 -0
- package/out/it/cap.js.map +1 -0
- package/out/it/index.d.ts +9 -0
- package/out/it/index.d.ts.map +1 -0
- package/out/it/index.js +9 -0
- package/out/it/index.js.map +1 -0
- package/out/normalize.d.ts +36 -0
- package/out/normalize.d.ts.map +1 -0
- package/out/normalize.js +51 -0
- package/out/normalize.js.map +1 -0
- package/out/nz/delivery-service.d.ts +10 -10
- package/out/nz/delivery-service.js +5 -5
- package/out/nz/postcode.d.ts +3 -3
- package/out/nz/postcode.js +2 -2
- package/out/postcode-systems.js +2 -2
- package/out/tools/build-country-surface-lexicon.js +2 -7
- package/out/tools/build-country-surface-lexicon.js.map +1 -1
- package/out/tools/generate-official-languages.d.ts.map +1 -1
- package/out/tools/generate-official-languages.js +4 -2
- package/out/tools/generate-official-languages.js.map +1 -1
- package/package.json +18 -2
- package/postcode-systems.ts +2 -2
- package/tools/build-country-surface-lexicon.ts +2 -10
- package/tools/generate-official-languages.ts +6 -1
package/out/fr/region.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* commune`. The region is inferred from the département, which is inferred from the postcode (see
|
|
13
13
|
* `code-postal.ts`).
|
|
14
14
|
*/
|
|
15
|
+
import { foldName } from "../normalize.js";
|
|
15
16
|
/**
|
|
16
17
|
* ISO 3166-2:FR region code → info, for all 18 régions (13 metropolitan + 5 overseas).
|
|
17
18
|
*/
|
|
@@ -42,17 +43,6 @@ const REGION_CODE_SET = new Set(Object.keys(FR_REGIONS));
|
|
|
42
43
|
export function isFrenchRegionCode(input) {
|
|
43
44
|
return typeof input === "string" && REGION_CODE_SET.has(input.toUpperCase());
|
|
44
45
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Strip diacritics + lowercase so `Île-de-France`, `ile-de-france`, `Ile de France` all key alike.
|
|
47
|
-
*/
|
|
48
|
-
function foldName(s) {
|
|
49
|
-
return s
|
|
50
|
-
.toLowerCase()
|
|
51
|
-
.normalize("NFD")
|
|
52
|
-
.replaceAll(/[\u0300-\u036F]/g, "")
|
|
53
|
-
.replaceAll(/[^a-z0-9]+/g, " ")
|
|
54
|
-
.trim();
|
|
55
|
-
}
|
|
56
46
|
/**
|
|
57
47
|
* Folded region name / code → ISO 3166-2:FR code. Built diacritic-insensitive so the resolver's surface form
|
|
58
48
|
* (`Île-de-France`, or an unaccented `Ile-de-France`) maps regardless of accents. Mirrors `de/bundesland.ts`'s
|
package/out/fr/region.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"region.js","sourceRoot":"","sources":["../../fr/region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"region.js","sourceRoot":"","sources":["../../fr/region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAgB1C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE;IAClD,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE;IACrD,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE;IACjD,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;IACnC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE;IACvC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE;IAC7C,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE;IAC3C,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE;IACvC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAChD,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE;IACvC,GAAG,EAAE,EAAE,IAAI,EAAE,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U,kBAAkB,CAAC,KAAgC;IAClE,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IACpD,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAExC,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,KAAyB,CAAA;IAEhE,OAAO,sBAAsB,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAA;AAC3D,CAAC"}
|
|
@@ -28,6 +28,15 @@ import type { UkCountryCode } from "./country.ts";
|
|
|
28
28
|
* Keeping only the non-England set makes the default transparent — anything not named here is England.
|
|
29
29
|
*/
|
|
30
30
|
export declare const GB_POSTCODE_AREA_COUNTRY: Record<string, UkCountryCode>;
|
|
31
|
+
/**
|
|
32
|
+
* The two postcode areas whose assignment in {@link GB_POSTCODE_AREA_COUNTRY} is a MAJORITY call rather than a fact —
|
|
33
|
+
* TD (Galashiels) straddles the Scotland/England border and SY (Shrewsbury) straddles the Wales/England border, and
|
|
34
|
+
* both carry real postcodes on the other side of the line. The header above documents them in prose; this is the same
|
|
35
|
+
* knowledge in a form a build can read, so an artifact that ASSERTS ancestry per postcode district can withhold the
|
|
36
|
+
* constituent country here instead of asserting a coin-flip. Consumers that only want the coarse majority answer keep
|
|
37
|
+
* using {@link countryOfPostcodeArea} and ignore this.
|
|
38
|
+
*/
|
|
39
|
+
export declare const GB_BORDER_STRADDLING_AREAS: ReadonlySet<string>;
|
|
31
40
|
/**
|
|
32
41
|
* The constituent country a postcode AREA belongs to. Returns the explicit country for a known non-England area (e.g.
|
|
33
42
|
* `BT` → `NIR`, `G` → `SCT`, `CF` → `WLS`), and `ENG` as the default for any other validly-shaped area — England is by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-area.d.ts","sourceRoot":"","sources":["../../gb/postcode-area.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AA2CjD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAIlE,CAAA;
|
|
1
|
+
{"version":3,"file":"postcode-area.d.ts","sourceRoot":"","sources":["../../gb/postcode-area.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AA2CjD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAIlE,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAAyB,CAAA;AASpF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAIzE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAQzE"}
|
package/out/gb/postcode-area.js
CHANGED
|
@@ -69,6 +69,15 @@ export const GB_POSTCODE_AREA_COUNTRY = {
|
|
|
69
69
|
...Object.fromEntries(SCOTLAND_AREAS.map((a) => [a, "SCT"])),
|
|
70
70
|
...Object.fromEntries(WALES_AREAS.map((a) => [a, "WLS"])),
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* The two postcode areas whose assignment in {@link GB_POSTCODE_AREA_COUNTRY} is a MAJORITY call rather than a fact —
|
|
74
|
+
* TD (Galashiels) straddles the Scotland/England border and SY (Shrewsbury) straddles the Wales/England border, and
|
|
75
|
+
* both carry real postcodes on the other side of the line. The header above documents them in prose; this is the same
|
|
76
|
+
* knowledge in a form a build can read, so an artifact that ASSERTS ancestry per postcode district can withhold the
|
|
77
|
+
* constituent country here instead of asserting a coin-flip. Consumers that only want the coarse majority answer keep
|
|
78
|
+
* using {@link countryOfPostcodeArea} and ignore this.
|
|
79
|
+
*/
|
|
80
|
+
export const GB_BORDER_STRADDLING_AREAS = new Set(["TD", "SY"]);
|
|
72
81
|
/**
|
|
73
82
|
* True when `area` looks like a valid postcode-area string: one or two ASCII letters.
|
|
74
83
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-area.js","sourceRoot":"","sources":["../../gb/postcode-area.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH;;GAEG;AACH,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAU,CAAA;AAE9C;;;GAGG;AACH,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,sCAAsC;IAC5C,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,gCAAgC;IACtC,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,kFAAkF;IACxF,IAAI,EAAE,qBAAqB;CAClB,CAAA;AAEV;;;GAGG;AACH,MAAM,WAAW,GAAG;IACnB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,kEAAkE;CAC/D,CAAA;AAEV;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkC;IACtE,GAAG,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EA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AAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAa;IAClD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAEnC,OAAO,wBAAwB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,KAAK,CAAA;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAiB;IAClD,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAC7C,kFAAkF;IAClF,MAAM,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAEhD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACvC,CAAC"}
|
package/out/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* subpath.
|
|
22
22
|
*/
|
|
23
23
|
export { ADDRESS_SYSTEM_CONVENTIONS, conventionsForSystem, type AddressSystemConventions, } from "./address-system-conventions.ts";
|
|
24
|
+
export * from "./normalize.ts";
|
|
24
25
|
export * as au from "./au/index.ts";
|
|
25
26
|
export * as ca from "./ca/index.ts";
|
|
26
27
|
export * as de from "./de/index.ts";
|
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,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;AACnC,OAAO,EAAE,2BAA2B,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACpF,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;AACnC,OAAO,EAAE,2BAA2B,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACpF,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* subpath.
|
|
22
22
|
*/
|
|
23
23
|
export { ADDRESS_SYSTEM_CONVENTIONS, conventionsForSystem, } from "./address-system-conventions.js";
|
|
24
|
+
export * from "./normalize.js";
|
|
24
25
|
export * as au from "./au/index.js";
|
|
25
26
|
export * as ca from "./ca/index.js";
|
|
26
27
|
export * as de from "./de/index.js";
|
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,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;AACnC,OAAO,EAAE,2BAA2B,EAAmB,MAAM,uBAAuB,CAAA;AACpF,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;AACnC,OAAO,EAAE,2BAA2B,EAAmB,MAAM,uBAAuB,CAAA;AACpF,OAAO,KAAK,EAAE,MAAM,eAAe,CAAA"}
|
package/out/it/cap.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Italian postal codes (Codice di Avviamento Postale, CAP): the branded type and the shape.
|
|
7
|
+
*
|
|
8
|
+
* Five digits like the Spanish, French and German forms, but do NOT infer a province from the
|
|
9
|
+
* leading digits the way `es/codigo-postal.ts` documents for Spain. Italy's large cities are
|
|
10
|
+
* assigned RANGES rather than a single code (Rome spans 00118–00199, Milan 20121–20162), and
|
|
11
|
+
* several provinces share leading digits, so the CAP narrows geography without identifying a
|
|
12
|
+
* province. It is the same trap German PLZ Leitzonen set, in a different disguise.
|
|
13
|
+
*/
|
|
14
|
+
import type { Tagged } from "type-fest";
|
|
15
|
+
/**
|
|
16
|
+
* An Italian postal code: five digits (`00184` is Rome, Rione Monti).
|
|
17
|
+
*
|
|
18
|
+
* @category Postal
|
|
19
|
+
* @type string
|
|
20
|
+
* @title CAP
|
|
21
|
+
* @pattern ^\d{5}$
|
|
22
|
+
*/
|
|
23
|
+
export type CAP = Tagged<string, "CAP">;
|
|
24
|
+
/**
|
|
25
|
+
* Shape of an Italian CAP — five digits.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CAP_PATTERN: RegExp;
|
|
28
|
+
/**
|
|
29
|
+
* Narrow a string to a {@link CAP}, or `null` when it is not one.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseCAP(input: string): CAP | null;
|
|
32
|
+
//# sourceMappingURL=cap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cap.d.ts","sourceRoot":"","sources":["../../it/cap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,WAAW,QAAY,CAAA;AAEpC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAIlD"}
|
package/out/it/cap.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Italian postal codes (Codice di Avviamento Postale, CAP): the branded type and the shape.
|
|
7
|
+
*
|
|
8
|
+
* Five digits like the Spanish, French and German forms, but do NOT infer a province from the
|
|
9
|
+
* leading digits the way `es/codigo-postal.ts` documents for Spain. Italy's large cities are
|
|
10
|
+
* assigned RANGES rather than a single code (Rome spans 00118–00199, Milan 20121–20162), and
|
|
11
|
+
* several provinces share leading digits, so the CAP narrows geography without identifying a
|
|
12
|
+
* province. It is the same trap German PLZ Leitzonen set, in a different disguise.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Shape of an Italian CAP — five digits.
|
|
16
|
+
*/
|
|
17
|
+
export const CAP_PATTERN = /^\d{5}$/;
|
|
18
|
+
/**
|
|
19
|
+
* Narrow a string to a {@link CAP}, or `null` when it is not one.
|
|
20
|
+
*/
|
|
21
|
+
export function parseCAP(input) {
|
|
22
|
+
const s = input.trim();
|
|
23
|
+
return CAP_PATTERN.test(s) ? s : null;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=cap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cap.js","sourceRoot":"","sources":["../../it/cap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAcH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAA;AAEpC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACrC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAEtB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAS,CAAC,CAAC,CAAC,IAAI,CAAA;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../it/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAA"}
|
package/out/it/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../it/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Name-normalization primitives shared across the codex tables and the lexicon builders that read
|
|
7
|
+
* them.
|
|
8
|
+
*
|
|
9
|
+
* These live in `@mailwoman/codex` rather than in `core` or `normalize` for one reason: codex is
|
|
10
|
+
* the zero-runtime-dependency reference package, and everything that needs to match a name against
|
|
11
|
+
* a codex table already depends on it. Putting the folding rules next to the tables they fold
|
|
12
|
+
* means a lookup and its table can never disagree about what counts as the same name.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Fold a name to its ASCII match key: lower-cased, accents stripped, every run of non-alphanumerics collapsed to a
|
|
17
|
+
* single space.
|
|
18
|
+
*
|
|
19
|
+
* This is the aggressive fold used to match a user's surface form against a codex table — `"Québec"` and `"QUEBEC"` and
|
|
20
|
+
* `"quebec"` all become `"quebec"`. It is lossy by design and never used to render anything back to a user.
|
|
21
|
+
*/
|
|
22
|
+
export declare function foldName(s: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Strip leading and trailing punctuation from every whitespace-separated word, dropping words that were nothing but
|
|
25
|
+
* punctuation, and rejoin on single spaces.
|
|
26
|
+
*
|
|
27
|
+
* Unlike {@link foldName} this preserves case and non-Latin scripts — it works on Unicode letter and number classes, so
|
|
28
|
+
* `"Кыргызстан,"` and `"日本 。"` survive with their content intact. That is what makes it the right normalizer for
|
|
29
|
+
* building surface lexicons, where the entry has to remain renderable, and the wrong one for building a match key.
|
|
30
|
+
*/
|
|
31
|
+
export declare function wordNorm(s: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* {@link wordNorm}, lower-cased — the case-insensitive lexicon key.
|
|
34
|
+
*/
|
|
35
|
+
export declare function wordNormLower(s: string): string;
|
|
36
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO1C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
package/out/normalize.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Name-normalization primitives shared across the codex tables and the lexicon builders that read
|
|
7
|
+
* them.
|
|
8
|
+
*
|
|
9
|
+
* These live in `@mailwoman/codex` rather than in `core` or `normalize` for one reason: codex is
|
|
10
|
+
* the zero-runtime-dependency reference package, and everything that needs to match a name against
|
|
11
|
+
* a codex table already depends on it. Putting the folding rules next to the tables they fold
|
|
12
|
+
* means a lookup and its table can never disagree about what counts as the same name.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Fold a name to its ASCII match key: lower-cased, accents stripped, every run of non-alphanumerics collapsed to a
|
|
17
|
+
* single space.
|
|
18
|
+
*
|
|
19
|
+
* This is the aggressive fold used to match a user's surface form against a codex table — `"Québec"` and `"QUEBEC"` and
|
|
20
|
+
* `"quebec"` all become `"quebec"`. It is lossy by design and never used to render anything back to a user.
|
|
21
|
+
*/
|
|
22
|
+
export function foldName(s) {
|
|
23
|
+
return s
|
|
24
|
+
.toLowerCase()
|
|
25
|
+
.normalize("NFD")
|
|
26
|
+
.replaceAll(/[\u0300-\u036F]/g, "")
|
|
27
|
+
.replaceAll(/[^a-z0-9]+/g, " ")
|
|
28
|
+
.trim();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Strip leading and trailing punctuation from every whitespace-separated word, dropping words that were nothing but
|
|
32
|
+
* punctuation, and rejoin on single spaces.
|
|
33
|
+
*
|
|
34
|
+
* Unlike {@link foldName} this preserves case and non-Latin scripts — it works on Unicode letter and number classes, so
|
|
35
|
+
* `"Кыргызстан,"` and `"日本 。"` survive with their content intact. That is what makes it the right normalizer for
|
|
36
|
+
* building surface lexicons, where the entry has to remain renderable, and the wrong one for building a match key.
|
|
37
|
+
*/
|
|
38
|
+
export function wordNorm(s) {
|
|
39
|
+
return s
|
|
40
|
+
.split(/\s+/)
|
|
41
|
+
.map((w) => w.replaceAll(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, ""))
|
|
42
|
+
.filter(Boolean)
|
|
43
|
+
.join(" ");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* {@link wordNorm}, lower-cased — the case-insensitive lexicon key.
|
|
47
|
+
*/
|
|
48
|
+
export function wordNormLower(s) {
|
|
49
|
+
return wordNorm(s).toLowerCase();
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAClC,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;SAC9B,IAAI,EAAE,CAAA;AACT,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,mCAAmC,EAAE,EAAE,CAAC,CAAC;SACjE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,CAAS;IACtC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;AACjC,CAAC"}
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
/**
|
|
45
45
|
* Identifier requirement per ADV358's Delivery Service Elements rules.
|
|
46
46
|
*/
|
|
47
|
-
export type
|
|
47
|
+
export type NZIdentifierRule = "required-if-allocated" | "optional" | "not-used";
|
|
48
48
|
/**
|
|
49
49
|
* One Delivery Service Type row from ADV358.
|
|
50
50
|
*/
|
|
51
|
-
export interface
|
|
51
|
+
export interface NZDeliveryServiceType {
|
|
52
52
|
/**
|
|
53
53
|
* The Delivery Service Type, verbatim casing per ADV358 ("PO Box", "Private Bag", "CMB").
|
|
54
54
|
*/
|
|
@@ -62,7 +62,7 @@ export interface NzDeliveryServiceType {
|
|
|
62
62
|
* none ("not used … for Private Bags that do not have an identifier allocated by New Zealand Post"); Counter Delivery
|
|
63
63
|
* and Poste Restante never carry one.
|
|
64
64
|
*/
|
|
65
|
-
identifier:
|
|
65
|
+
identifier: NZIdentifierRule;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* The six Delivery Service Types, verbatim from ADV358 (see the module header).
|
|
@@ -95,7 +95,7 @@ export declare const NZ_DELIVERY_SERVICE_TYPES: readonly [{
|
|
|
95
95
|
/**
|
|
96
96
|
* A canonical NZ Delivery Service Type.
|
|
97
97
|
*/
|
|
98
|
-
export type
|
|
98
|
+
export type NZDeliveryServiceTypeName = (typeof NZ_DELIVERY_SERVICE_TYPES)[number]["type"];
|
|
99
99
|
/**
|
|
100
100
|
* Metadata for the colloquial "Private Box" alias (see the module header and operator ruling 2026-06-11). Kept separate
|
|
101
101
|
* from {@link NZ_DELIVERY_SERVICE_TYPES} because it is NOT a valid ADV358 Delivery Service Type — recognition and
|
|
@@ -130,11 +130,11 @@ export declare const NZ_PRIVATE_BOX_ALIAS: {
|
|
|
130
130
|
/**
|
|
131
131
|
* Extended type name union including the colloquial alias recognized for parsing.
|
|
132
132
|
*/
|
|
133
|
-
export type
|
|
133
|
+
export type NZDeliveryServiceMatchTypeName = NZDeliveryServiceTypeName | "Private Box";
|
|
134
134
|
/**
|
|
135
135
|
* Result of an NZ delivery-service parse.
|
|
136
136
|
*/
|
|
137
|
-
export interface
|
|
137
|
+
export interface NZDeliveryServiceMatch {
|
|
138
138
|
/**
|
|
139
139
|
* The designator phrase as it appeared ("PO Box", "private bag", "Private Box").
|
|
140
140
|
*/
|
|
@@ -144,7 +144,7 @@ export interface NzDeliveryServiceMatch {
|
|
|
144
144
|
* `type` is "Private Box", `colloquial` is true and `officiallyInvalid` is true — the form is not a valid ADV358
|
|
145
145
|
* type.
|
|
146
146
|
*/
|
|
147
|
-
type:
|
|
147
|
+
type: NZDeliveryServiceMatchTypeName;
|
|
148
148
|
/**
|
|
149
149
|
* The Delivery Service Identifier when present ("24999", "B99").
|
|
150
150
|
*/
|
|
@@ -164,14 +164,14 @@ export interface NzDeliveryServiceMatch {
|
|
|
164
164
|
* Delivery Service Type; see {@link NZ_PRIVATE_BOX_ALIAS} and operator ruling 2026-06-11). Callers that want only
|
|
165
165
|
* formally-valid ADV358 types should check `!result.colloquial`.
|
|
166
166
|
*/
|
|
167
|
-
export declare function
|
|
167
|
+
export declare function matchNZDeliveryService(input: unknown): NZDeliveryServiceMatch | null;
|
|
168
168
|
/**
|
|
169
169
|
* Type-predicate: does the input look like a standalone NZ delivery-service address line?
|
|
170
170
|
*/
|
|
171
|
-
export declare function
|
|
171
|
+
export declare function isNZDeliveryService(input: unknown): boolean;
|
|
172
172
|
/**
|
|
173
173
|
* Normalize a recognized phrase to the ADV358 form (`"p.o. box 24999"` → `"PO Box 24999"`). Returns the input unchanged
|
|
174
174
|
* if it isn't a delivery-service phrase.
|
|
175
175
|
*/
|
|
176
|
-
export declare function
|
|
176
|
+
export declare function normalizeNZDeliveryService(input: string): string;
|
|
177
177
|
//# sourceMappingURL=delivery-service.d.ts.map
|
|
@@ -135,7 +135,7 @@ const MATCHERS = TYPE_PATTERNS.map(([type, src]) => {
|
|
|
135
135
|
* Delivery Service Type; see {@link NZ_PRIVATE_BOX_ALIAS} and operator ruling 2026-06-11). Callers that want only
|
|
136
136
|
* formally-valid ADV358 types should check `!result.colloquial`.
|
|
137
137
|
*/
|
|
138
|
-
export function
|
|
138
|
+
export function matchNZDeliveryService(input) {
|
|
139
139
|
if (typeof input !== "string")
|
|
140
140
|
return null;
|
|
141
141
|
for (const { type, re } of MATCHERS) {
|
|
@@ -150,15 +150,15 @@ export function matchNzDeliveryService(input) {
|
|
|
150
150
|
/**
|
|
151
151
|
* Type-predicate: does the input look like a standalone NZ delivery-service address line?
|
|
152
152
|
*/
|
|
153
|
-
export function
|
|
154
|
-
return
|
|
153
|
+
export function isNZDeliveryService(input) {
|
|
154
|
+
return matchNZDeliveryService(input) !== null;
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
157
|
* Normalize a recognized phrase to the ADV358 form (`"p.o. box 24999"` → `"PO Box 24999"`). Returns the input unchanged
|
|
158
158
|
* if it isn't a delivery-service phrase.
|
|
159
159
|
*/
|
|
160
|
-
export function
|
|
161
|
-
const m =
|
|
160
|
+
export function normalizeNZDeliveryService(input) {
|
|
161
|
+
const m = matchNZDeliveryService(input);
|
|
162
162
|
if (!m)
|
|
163
163
|
return input;
|
|
164
164
|
return m.id ? `${m.type} ${m.id.toUpperCase()}` : m.type;
|
package/out/nz/postcode.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type { Tagged } from "type-fest";
|
|
|
21
21
|
* @title New Zealand postcode
|
|
22
22
|
* @pattern ^\d{4}$
|
|
23
23
|
*/
|
|
24
|
-
export type
|
|
24
|
+
export type NZPostcode = Tagged<string, "NZPostcode">;
|
|
25
25
|
/**
|
|
26
26
|
* The NZ postcode shape: exactly four digits.
|
|
27
27
|
*/
|
|
@@ -29,9 +29,9 @@ export declare const NZ_POSTCODE_PATTERN: RegExp;
|
|
|
29
29
|
/**
|
|
30
30
|
* Normalize a postcode surface form (trim only — NZ has no country-prefix courtesy form).
|
|
31
31
|
*/
|
|
32
|
-
export declare function
|
|
32
|
+
export declare function normalizeNZPostcode(raw: unknown): NZPostcode | null;
|
|
33
33
|
/**
|
|
34
34
|
* Type-predicate for a (normalized) New Zealand postcode.
|
|
35
35
|
*/
|
|
36
|
-
export declare function
|
|
36
|
+
export declare function isNZPostcode(input: unknown): input is NZPostcode;
|
|
37
37
|
//# sourceMappingURL=postcode.d.ts.map
|
package/out/nz/postcode.js
CHANGED
|
@@ -19,7 +19,7 @@ export const NZ_POSTCODE_PATTERN = /^\d{4}$/;
|
|
|
19
19
|
/**
|
|
20
20
|
* Normalize a postcode surface form (trim only — NZ has no country-prefix courtesy form).
|
|
21
21
|
*/
|
|
22
|
-
export function
|
|
22
|
+
export function normalizeNZPostcode(raw) {
|
|
23
23
|
if (typeof raw !== "string")
|
|
24
24
|
return null;
|
|
25
25
|
const s = raw.trim();
|
|
@@ -28,7 +28,7 @@ export function normalizeNzPostcode(raw) {
|
|
|
28
28
|
/**
|
|
29
29
|
* Type-predicate for a (normalized) New Zealand postcode.
|
|
30
30
|
*/
|
|
31
|
-
export function
|
|
31
|
+
export function isNZPostcode(input) {
|
|
32
32
|
return typeof input === "string" && NZ_POSTCODE_PATTERN.test(input);
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=postcode.js.map
|
package/out/postcode-systems.js
CHANGED
|
@@ -26,7 +26,7 @@ import { normalizePLZ } from "./de/index.js";
|
|
|
26
26
|
import { normalizeCodePostal } from "./fr/index.js";
|
|
27
27
|
import { normalizeUkPostcode } from "./gb/index.js";
|
|
28
28
|
import { normalizeJpPostalCode } from "./jp/index.js";
|
|
29
|
-
import {
|
|
29
|
+
import { normalizeNZPostcode } from "./nz/index.js";
|
|
30
30
|
import { isZipCode } from "./us/index.js";
|
|
31
31
|
/**
|
|
32
32
|
* Per-system membership test: each entry returns true when the string is accepted by that system's own postcode shape
|
|
@@ -41,7 +41,7 @@ const SYSTEM_ACCEPTS = [
|
|
|
41
41
|
["gb", (s) => normalizeUkPostcode(s) !== null],
|
|
42
42
|
["jp", (s) => normalizeJpPostalCode(s) !== null],
|
|
43
43
|
["au", (s) => normalizeAuPostcode(s) !== null],
|
|
44
|
-
["nz", (s) =>
|
|
44
|
+
["nz", (s) => normalizeNZPostcode(s) !== null],
|
|
45
45
|
];
|
|
46
46
|
/**
|
|
47
47
|
* Every address system whose own postcode shape accepts `postcode`. Empty when no system recognizes the shape (e.g. a
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
43
43
|
import { dirname, resolve } from "node:path";
|
|
44
44
|
import { COUNTRY_SURFACE_FORMS, ISO2_TO_NAME } from "../country/country.js";
|
|
45
|
+
import { wordNorm, wordNormLower } from "../normalize.js";
|
|
45
46
|
import { US_STATE_ABBREVIATIONS, US_STATE_NAMES } from "../us/state.js";
|
|
46
47
|
/**
|
|
47
48
|
* Ambiguous entries printed before the list is truncated.
|
|
@@ -64,12 +65,6 @@ const OUTPUT = resolve(import.meta.dirname, "../../data/gazetteer/country-surfac
|
|
|
64
65
|
* letters or digits (keep internal ones: "u.s.a", "timor-leste"), rejoin single-spaced. Entry keys and scanned tokens
|
|
65
66
|
* both pass through it, so "U.S.A." ≡ "u.s.a".
|
|
66
67
|
*/
|
|
67
|
-
const wordNorm = (s) => s
|
|
68
|
-
.split(/\s+/)
|
|
69
|
-
.map((w) => w.replaceAll(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, ""))
|
|
70
|
-
.filter(Boolean)
|
|
71
|
-
.join(" ");
|
|
72
|
-
const norm = (s) => wordNorm(s).toLowerCase();
|
|
73
68
|
/**
|
|
74
69
|
* Short alphabetic code (≤3 letters once punctuation is dropped) → exact-uppercase matching.
|
|
75
70
|
*/
|
|
@@ -106,7 +101,7 @@ function add(surface) {
|
|
|
106
101
|
codeEntries.set(key, (codeEntries.get(key) ?? 0) | bits);
|
|
107
102
|
return;
|
|
108
103
|
}
|
|
109
|
-
const key =
|
|
104
|
+
const key = wordNormLower(s);
|
|
110
105
|
if (!key)
|
|
111
106
|
return;
|
|
112
107
|
const words = key.split(" ");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-country-surface-lexicon.js","sourceRoot":"","sources":["../../tools/build-country-surface-lexicon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,EA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Aa,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7F,CAAA;AAED,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AAC/C,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;AAE9D,OAAO,CAAC,MAAM,CAAC,KAAK,CACnB,SAAS,MAAM,KAAK,OAAO,CAAC,IAAI,cAAc,WAAW,CAAC,IAAI,iBAAiB;IAC9E,aAAa,QAAQ,KAAK,gBAAgB,CAAC,MAAM,eAAe,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAC7L,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-official-languages.d.ts","sourceRoot":"","sources":["../../tools/generate-official-languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"generate-official-languages.d.ts","sourceRoot":"","sources":["../../tools/generate-official-languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAeH;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CACf;AAmBD;;GAEG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,GAAE,gCAAqC,EAC9C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,gCAAgC,CAAC,CA2H3C"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
22
22
|
import { join } from "node:path";
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
|
+
import { parseJSONStrict } from "@mailwoman/core/objects";
|
|
24
25
|
/**
|
|
25
26
|
* The committed output path, resolved relative to this module (codex/tools/ → codex/country/). The codegen is
|
|
26
27
|
* repo-only, and in the repo `@mailwoman/codex/tools` always loads from source via the `node` exports condition, so
|
|
@@ -28,8 +29,9 @@ import { fileURLToPath } from "node:url";
|
|
|
28
29
|
*/
|
|
29
30
|
const DEFAULT_OUT = fileURLToPath(new URL("../country/official-languages.ts", import.meta.url));
|
|
30
31
|
async function loadCLDR(file, cldrDir, cldrVersion) {
|
|
31
|
-
if (cldrDir)
|
|
32
|
-
return
|
|
32
|
+
if (cldrDir) {
|
|
33
|
+
return parseJSONStrict(readFileSync(join(cldrDir, `cldr-${file}.json`), "utf8"));
|
|
34
|
+
}
|
|
33
35
|
const url = `https://cdn.jsdelivr.net/npm/cldr-core@${cldrVersion}/supplemental/${file}.json`;
|
|
34
36
|
const res = await fetch(url);
|
|
35
37
|
if (!res.ok)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-official-languages.js","sourceRoot":"","sources":["../../tools/generate-official-languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC;;;;GAIG;AACH,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,GAAG,C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
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Per-address-system postal reference data + branded types (USPS street suffixes, US ZIP codes). Pure, zero-runtime-dep — the shared canonical home for postal-system primitives the parser, resolver, and synthesis layers all reach for.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -68,6 +68,14 @@
|
|
|
68
68
|
"./tools": {
|
|
69
69
|
"types": "./out/tools/index.d.ts",
|
|
70
70
|
"default": "./out/tools/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./es": {
|
|
73
|
+
"types": "./out/es/index.d.ts",
|
|
74
|
+
"default": "./out/es/index.js"
|
|
75
|
+
},
|
|
76
|
+
"./it": {
|
|
77
|
+
"types": "./out/it/index.d.ts",
|
|
78
|
+
"default": "./out/it/index.js"
|
|
71
79
|
}
|
|
72
80
|
},
|
|
73
81
|
"publishConfig": {
|
|
@@ -117,6 +125,14 @@
|
|
|
117
125
|
"./tools": {
|
|
118
126
|
"types": "./out/tools/index.d.ts",
|
|
119
127
|
"default": "./out/tools/index.js"
|
|
128
|
+
},
|
|
129
|
+
"./es": {
|
|
130
|
+
"types": "./out/es/index.d.ts",
|
|
131
|
+
"default": "./out/es/index.js"
|
|
132
|
+
},
|
|
133
|
+
"./it": {
|
|
134
|
+
"types": "./out/it/index.d.ts",
|
|
135
|
+
"default": "./out/it/index.js"
|
|
120
136
|
}
|
|
121
137
|
}
|
|
122
138
|
},
|
|
@@ -124,6 +140,6 @@
|
|
|
124
140
|
"type-fest": "^5.8.0"
|
|
125
141
|
},
|
|
126
142
|
"devDependencies": {
|
|
127
|
-
"@mailwoman/annotations": "
|
|
143
|
+
"@mailwoman/annotations": "9.0.0"
|
|
128
144
|
}
|
|
129
145
|
}
|