@mailwoman/codex 8.0.0 → 8.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/address-system-conventions.ts +7 -1
- package/au/delivery-service.ts +34 -12
- package/au/level-designator.ts +38 -14
- package/au/postcode.ts +9 -3
- package/au/state.ts +9 -3
- package/ca/postal-code.ts +10 -3
- package/ca/province.ts +23 -9
- package/ca/street-type.ts +9 -5
- package/country/country.ts +14 -8
- package/country/official-languages.ts +12 -4
- package/country/reference-data.ts +7 -3
- package/country/reference.ts +1 -1
- package/country/subdivision.ts +19 -8
- package/de/bundesland.ts +19 -6
- package/de/postleitzahl.ts +21 -7
- package/de/street-type.ts +14 -3
- package/fr/cedex.ts +15 -5
- package/fr/code-postal.ts +17 -4
- package/fr/departement.ts +18 -6
- package/fr/region.ts +23 -9
- package/fr/voie.ts +8 -4
- package/gb/country.ts +25 -9
- package/gb/postcode-area.ts +6 -2
- package/gb/postcode.ts +10 -3
- package/gb/street-type.ts +4 -2
- package/index.ts +1 -0
- package/jp/address-unit.ts +8 -4
- package/jp/postal-code.ts +7 -3
- package/jp/prefecture.ts +27 -10
- package/level-semantics.ts +55 -19
- package/nz/delivery-service.ts +43 -15
- package/nz/postcode.ts +9 -3
- package/out/address-system-conventions.d.ts +7 -1
- package/out/address-system-conventions.d.ts.map +1 -1
- package/out/address-system-conventions.js +7 -1
- package/out/address-system-conventions.js.map +1 -1
- package/out/au/delivery-service.d.ts +30 -10
- package/out/au/delivery-service.d.ts.map +1 -1
- package/out/au/delivery-service.js +7 -3
- package/out/au/delivery-service.js.map +1 -1
- package/out/au/level-designator.d.ts +27 -9
- package/out/au/level-designator.d.ts.map +1 -1
- package/out/au/level-designator.js +10 -6
- package/out/au/level-designator.js.map +1 -1
- package/out/au/postcode.d.ts +9 -3
- package/out/au/postcode.d.ts.map +1 -1
- package/out/au/postcode.js +9 -3
- package/out/au/postcode.js.map +1 -1
- package/out/au/state.d.ts +9 -3
- package/out/au/state.d.ts.map +1 -1
- package/out/au/state.js +6 -2
- package/out/au/state.js.map +1 -1
- package/out/ca/postal-code.d.ts +3 -1
- package/out/ca/postal-code.d.ts.map +1 -1
- package/out/ca/postal-code.js +9 -3
- package/out/ca/postal-code.js.map +1 -1
- package/out/ca/province.d.ts +18 -6
- package/out/ca/province.d.ts.map +1 -1
- package/out/ca/province.js +8 -4
- package/out/ca/province.js.map +1 -1
- package/out/ca/street-type.d.ts.map +1 -1
- package/out/ca/street-type.js +9 -5
- package/out/ca/street-type.js.map +1 -1
- package/out/country/country.d.ts +11 -7
- package/out/country/country.d.ts.map +1 -1
- package/out/country/country.js +7 -4
- package/out/country/country.js.map +1 -1
- package/out/country/official-languages.d.ts +12 -4
- package/out/country/official-languages.d.ts.map +1 -1
- package/out/country/official-languages.js +3 -1
- package/out/country/official-languages.js.map +1 -1
- package/out/country/reference-data.d.ts +6 -2
- package/out/country/reference-data.d.ts.map +1 -1
- package/out/country/reference-data.js +4 -2
- package/out/country/reference-data.js.map +1 -1
- package/out/country/reference.js +1 -1
- package/out/country/reference.js.map +1 -1
- package/out/country/subdivision.d.ts +12 -4
- package/out/country/subdivision.d.ts.map +1 -1
- package/out/country/subdivision.js +6 -4
- package/out/country/subdivision.js.map +1 -1
- package/out/de/bundesland.d.ts +18 -6
- package/out/de/bundesland.d.ts.map +1 -1
- package/out/de/bundesland.js +3 -1
- package/out/de/bundesland.js.map +1 -1
- package/out/de/postleitzahl.d.ts +21 -7
- package/out/de/postleitzahl.d.ts.map +1 -1
- package/out/de/postleitzahl.js +9 -3
- package/out/de/postleitzahl.js.map +1 -1
- package/out/de/street-type.d.ts +5 -4
- package/out/de/street-type.d.ts.map +1 -1
- package/out/de/street-type.js +10 -2
- package/out/de/street-type.js.map +1 -1
- package/out/fr/cedex.d.ts +15 -5
- package/out/fr/cedex.d.ts.map +1 -1
- package/out/fr/cedex.js +6 -2
- package/out/fr/cedex.js.map +1 -1
- package/out/fr/code-postal.d.ts +8 -11
- package/out/fr/code-postal.d.ts.map +1 -1
- package/out/fr/code-postal.js +24 -4
- package/out/fr/code-postal.js.map +1 -1
- package/out/fr/departement.d.ts +18 -6
- package/out/fr/departement.d.ts.map +1 -1
- package/out/fr/departement.js +3 -1
- package/out/fr/departement.js.map +1 -1
- package/out/fr/region.d.ts +18 -6
- package/out/fr/region.d.ts.map +1 -1
- package/out/fr/region.js +11 -5
- package/out/fr/region.js.map +1 -1
- package/out/fr/voie.d.ts +3 -1
- package/out/fr/voie.d.ts.map +1 -1
- package/out/fr/voie.js +3 -3
- package/out/fr/voie.js.map +1 -1
- package/out/gb/country.d.ts +18 -6
- package/out/gb/country.d.ts.map +1 -1
- package/out/gb/country.js +13 -5
- package/out/gb/country.js.map +1 -1
- package/out/gb/postcode-area.d.ts.map +1 -1
- package/out/gb/postcode-area.js +6 -2
- package/out/gb/postcode-area.js.map +1 -1
- package/out/gb/postcode.d.ts +3 -11
- package/out/gb/postcode.d.ts.map +1 -1
- package/out/gb/postcode.js +19 -3
- package/out/gb/postcode.js.map +1 -1
- package/out/gb/street-type.d.ts +3 -1
- package/out/gb/street-type.d.ts.map +1 -1
- package/out/gb/street-type.js +1 -1
- package/out/gb/street-type.js.map +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js.map +1 -1
- package/out/jp/address-unit.d.ts +6 -2
- package/out/jp/address-unit.d.ts.map +1 -1
- package/out/jp/address-unit.js +2 -2
- package/out/jp/address-unit.js.map +1 -1
- package/out/jp/postal-code.d.ts +6 -2
- package/out/jp/postal-code.d.ts.map +1 -1
- package/out/jp/postal-code.js +7 -3
- package/out/jp/postal-code.js.map +1 -1
- package/out/jp/prefecture.d.ts +24 -8
- package/out/jp/prefecture.d.ts.map +1 -1
- package/out/jp/prefecture.js +5 -3
- package/out/jp/prefecture.js.map +1 -1
- package/out/level-semantics.d.ts +48 -16
- package/out/level-semantics.d.ts.map +1 -1
- package/out/level-semantics.js +34 -12
- package/out/level-semantics.js.map +1 -1
- package/out/nz/delivery-service.d.ts +39 -13
- package/out/nz/delivery-service.d.ts.map +1 -1
- package/out/nz/delivery-service.js +16 -6
- package/out/nz/delivery-service.js.map +1 -1
- package/out/nz/postcode.d.ts +9 -3
- package/out/nz/postcode.d.ts.map +1 -1
- package/out/nz/postcode.js +9 -3
- package/out/nz/postcode.js.map +1 -1
- package/out/postcode-systems.d.ts +3 -1
- package/out/postcode-systems.d.ts.map +1 -1
- package/out/postcode-systems.js +1 -1
- package/out/postcode-systems.js.map +1 -1
- package/out/tools/build-country-surface-lexicon.js +26 -12
- package/out/tools/build-country-surface-lexicon.js.map +1 -1
- package/out/tools/export-country-surfaces.js.map +1 -1
- package/out/tools/generate-country-reference.d.ts +12 -4
- package/out/tools/generate-country-reference.d.ts.map +1 -1
- package/out/tools/generate-country-reference.js +10 -8
- package/out/tools/generate-country-reference.js.map +1 -1
- package/out/tools/generate-official-languages.d.ts +18 -6
- package/out/tools/generate-official-languages.d.ts.map +1 -1
- package/out/tools/generate-official-languages.js +9 -7
- package/out/tools/generate-official-languages.js.map +1 -1
- package/out/us/floor-designator.d.ts +15 -5
- package/out/us/floor-designator.d.ts.map +1 -1
- package/out/us/floor-designator.js +3 -1
- package/out/us/floor-designator.js.map +1 -1
- package/out/us/military-address.d.ts +36 -12
- package/out/us/military-address.d.ts.map +1 -1
- package/out/us/military-address.js +26 -15
- package/out/us/military-address.js.map +1 -1
- package/out/us/po-box.d.ts +9 -3
- package/out/us/po-box.d.ts.map +1 -1
- package/out/us/po-box.js +4 -2
- package/out/us/po-box.js.map +1 -1
- package/out/us/state.d.ts +6 -2
- package/out/us/state.d.ts.map +1 -1
- package/out/us/state.js +3 -1
- package/out/us/state.js.map +1 -1
- package/out/us/street-directional.d.ts +12 -3
- package/out/us/street-directional.d.ts.map +1 -1
- package/out/us/street-directional.js +8 -3
- package/out/us/street-directional.js.map +1 -1
- package/out/us/street-suffix.d.ts +24 -8
- package/out/us/street-suffix.d.ts.map +1 -1
- package/out/us/street-suffix.js +7 -3
- package/out/us/street-suffix.js.map +1 -1
- package/out/us/unit-designator.d.ts +24 -8
- package/out/us/unit-designator.d.ts.map +1 -1
- package/out/us/unit-designator.js +3 -1
- package/out/us/unit-designator.js.map +1 -1
- package/package.json +2 -2
- package/postcode-systems.ts +4 -2
- package/tools/build-country-surface-lexicon.ts +30 -12
- package/tools/export-country-surfaces.ts +2 -0
- package/tools/generate-country-reference.ts +27 -13
- package/tools/generate-official-languages.ts +27 -12
- package/us/floor-designator.ts +15 -5
- package/us/military-address.ts +53 -24
- package/us/po-box.ts +13 -5
- package/us/state.ts +6 -2
- package/us/street-directional.ts +14 -5
- package/us/street-suffix.ts +27 -9
- package/us/unit-designator.ts +25 -8
package/out/fr/code-postal.d.ts
CHANGED
|
@@ -26,24 +26,19 @@
|
|
|
26
26
|
import type { Tagged } from "type-fest";
|
|
27
27
|
import { type DepartementCode, type DepartementInfo } from "./departement.ts";
|
|
28
28
|
import { type FrenchRegionInfo } from "./region.ts";
|
|
29
|
+
export type CodePostal = Tagged<string, "CodePostal">;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
* disambiguate the country.
|
|
32
|
-
*
|
|
33
|
-
* @category Postal
|
|
34
|
-
* @type string
|
|
35
|
-
* @title Code postal
|
|
36
|
-
* @pattern ^\d{5}$
|
|
31
|
+
* The code-postal shape: exactly five digits.
|
|
37
32
|
*/
|
|
38
|
-
export type CodePostal = Tagged<string, "CodePostal">;
|
|
39
|
-
/** The code-postal shape: exactly five digits. */
|
|
40
33
|
export declare const CODE_POSTAL_PATTERN: RegExp;
|
|
41
34
|
/**
|
|
42
35
|
* Normalize a code-postal surface form to the bare five digits: strip an `F-` country courtesy prefix and surrounding
|
|
43
36
|
* whitespace (`F-75008` → `75008`). Returns null if the result is not five digits.
|
|
44
37
|
*/
|
|
45
38
|
export declare function normalizeCodePostal(raw: unknown): CodePostal | null;
|
|
46
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Type-predicate for a (normalized) French postal code.
|
|
41
|
+
*/
|
|
47
42
|
export declare function isCodePostal(input: unknown): input is CodePostal;
|
|
48
43
|
/**
|
|
49
44
|
* The département code a postal code belongs to. The clean rule plus its two exceptions:
|
|
@@ -56,7 +51,9 @@ export declare function isCodePostal(input: unknown): input is CodePostal;
|
|
|
56
51
|
* Returns null for a prefix with no département (e.g. `975`/`977`/`98x` collectivities, or a malformed code).
|
|
57
52
|
*/
|
|
58
53
|
export declare function departementOfCodePostal(codePostal: unknown): DepartementCode | null;
|
|
59
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The full département record a postal code resolves to (name + région), or null.
|
|
56
|
+
*/
|
|
60
57
|
export declare function departementForCodePostal(codePostal: unknown): DepartementInfo | null;
|
|
61
58
|
/**
|
|
62
59
|
* The région a postal code resolves to, via its département; null if the code maps to no département.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-postal.d.ts","sourceRoot":"","sources":["../../fr/code-postal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAmB,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC9F,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"code-postal.d.ts","sourceRoot":"","sources":["../../fr/code-postal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAmB,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC9F,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAiB/D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAY,CAAA;AAE5C;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAKnE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAoBnF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAEpF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAIhF"}
|
package/out/fr/code-postal.js
CHANGED
|
@@ -25,7 +25,23 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import { departementInfo } from "./departement.js";
|
|
27
27
|
import { FR_REGIONS } from "./region.js";
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* A French postal code: five digits (`75008`). Same shape as a US ZIP or a German PLZ — the shape alone does not
|
|
30
|
+
* disambiguate the country.
|
|
31
|
+
*
|
|
32
|
+
* @category Postal
|
|
33
|
+
* @type string
|
|
34
|
+
* @title Code postal
|
|
35
|
+
* @pattern ^\d{5}$
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Postcode at which Corsica splits between departments 2A (Corse-du-Sud) and 2B (Haute-Corse). Both share the 20xxx
|
|
39
|
+
* range, so the numeric boundary is the only way to tell them apart.
|
|
40
|
+
*/
|
|
41
|
+
const CORSICA_2A_2B_BOUNDARY = 20_200;
|
|
42
|
+
/**
|
|
43
|
+
* The code-postal shape: exactly five digits.
|
|
44
|
+
*/
|
|
29
45
|
export const CODE_POSTAL_PATTERN = /^\d{5}$/;
|
|
30
46
|
/**
|
|
31
47
|
* Normalize a code-postal surface form to the bare five digits: strip an `F-` country courtesy prefix and surrounding
|
|
@@ -37,7 +53,9 @@ export function normalizeCodePostal(raw) {
|
|
|
37
53
|
const s = raw.trim().toUpperCase().replace(/^F-/, "");
|
|
38
54
|
return CODE_POSTAL_PATTERN.test(s) ? s : null;
|
|
39
55
|
}
|
|
40
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Type-predicate for a (normalized) French postal code.
|
|
58
|
+
*/
|
|
41
59
|
export function isCodePostal(input) {
|
|
42
60
|
return typeof input === "string" && CODE_POSTAL_PATTERN.test(input);
|
|
43
61
|
}
|
|
@@ -57,7 +75,7 @@ export function departementOfCodePostal(codePostal) {
|
|
|
57
75
|
return null;
|
|
58
76
|
if (cp.startsWith("20")) {
|
|
59
77
|
// Corsica: prefix 20 covers both départements; the numeric value splits them.
|
|
60
|
-
return Number(cp) <
|
|
78
|
+
return Number(cp) < CORSICA_2A_2B_BOUNDARY ? "2A" : "2B";
|
|
61
79
|
}
|
|
62
80
|
if (cp.startsWith("97") || cp.startsWith("98")) {
|
|
63
81
|
// Overseas: three-digit prefix. Only the five DOM are départements.
|
|
@@ -67,7 +85,9 @@ export function departementOfCodePostal(codePostal) {
|
|
|
67
85
|
const dd = cp.slice(0, 2);
|
|
68
86
|
return departementInfo(dd) ? dd : null;
|
|
69
87
|
}
|
|
70
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* The full département record a postal code resolves to (name + région), or null.
|
|
90
|
+
*/
|
|
71
91
|
export function departementForCodePostal(codePostal) {
|
|
72
92
|
return departementInfo(departementOfCodePostal(codePostal));
|
|
73
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-postal.js","sourceRoot":"","sources":["../../fr/code-postal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAE,eAAe,EAA8C,MAAM,kBAAkB,CAAA;AAC9F,OAAO,EAAE,UAAU,EAAyB,MAAM,aAAa,CAAA;
|
|
1
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U,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,oEAAoE;QACpE,MAAM,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAE1B,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,GAAuB,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9D,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEzB,OAAO,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,EAAsB,CAAC,CAAC,CAAC,IAAI,CAAA;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAmB;IAC3D,OAAO,eAAe,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAA;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAmB;IACtD,MAAM,GAAG,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAA;IAEhD,OAAO,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC3C,CAAC"}
|
package/out/fr/departement.d.ts
CHANGED
|
@@ -11,16 +11,26 @@
|
|
|
11
11
|
* département. This table is therefore the hinge between `code-postal.ts` and `region.ts`.
|
|
12
12
|
*/
|
|
13
13
|
import type { FrenchRegionCode } from "./region.ts";
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Per-département record: code (2-digit, or `2A`/`2B`, or 3-digit DOM) + name + its région.
|
|
16
|
+
*/
|
|
15
17
|
export interface DepartementInfo {
|
|
16
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Département code: `01`–`95` (metropolitan), `2A`/`2B` (Corsica), or `971`–`976` (overseas).
|
|
20
|
+
*/
|
|
17
21
|
code: string;
|
|
18
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* French name (e.g. `Bouches-du-Rhône`).
|
|
24
|
+
*/
|
|
19
25
|
name: string;
|
|
20
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The ISO 3166-2:FR code of the région this département belongs to.
|
|
28
|
+
*/
|
|
21
29
|
region: FrenchRegionCode;
|
|
22
30
|
}
|
|
23
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Département code → info. 96 metropolitan (incl. 2A/2B) + 5 overseas = 101.
|
|
33
|
+
*/
|
|
24
34
|
export declare const FR_DEPARTEMENTS: {
|
|
25
35
|
readonly "01": {
|
|
26
36
|
readonly code: "01";
|
|
@@ -528,7 +538,9 @@ export declare const FR_DEPARTEMENTS: {
|
|
|
528
538
|
readonly region: "MAY";
|
|
529
539
|
};
|
|
530
540
|
};
|
|
531
|
-
/**
|
|
541
|
+
/**
|
|
542
|
+
* A French département code (`01`–`95`, `2A`/`2B`, or `971`–`976`).
|
|
543
|
+
*/
|
|
532
544
|
export type DepartementCode = keyof typeof FR_DEPARTEMENTS;
|
|
533
545
|
/**
|
|
534
546
|
* Look up a département by code (case-insensitive for the Corsica `2A`/`2B` letters); null if unknown.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"departement.d.ts","sourceRoot":"","sources":["../../fr/departement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD
|
|
1
|
+
{"version":3,"file":"departement.d.ts","sourceRoot":"","sources":["../../fr/departement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAA;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGwB,CAAA;AAEpD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAA;AAE1D;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI,CAKvF"}
|
package/out/fr/departement.js
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* digits ARE the département number (see `code-postal.ts`), and the région is derived from the
|
|
11
11
|
* département. This table is therefore the hinge between `code-postal.ts` and `region.ts`.
|
|
12
12
|
*/
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Département code → info. 96 metropolitan (incl. 2A/2B) + 5 overseas = 101.
|
|
15
|
+
*/
|
|
14
16
|
export const FR_DEPARTEMENTS = {
|
|
15
17
|
"01": { code: "01", name: "Ain", region: "ARA" },
|
|
16
18
|
"02": { code: "02", name: "Aisne", region: "HDF" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"departement.js","sourceRoot":"","sources":["../../fr/departement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"departement.js","sourceRoot":"","sources":["../../fr/departement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsBH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;IAChD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAClD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;IACnD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,KAAK,EAAE;IACpE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE;IACzD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE;IAC5D,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE;IACpD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE;IACrD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;IACnD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,E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E,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;IACrD,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE;IACzD,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE;CACH,CAAA;AAOpD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAA+B;IAC9D,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAErC,OAAQ,eAAmD,CAAC,GAAG,CAAC,IAAI,IAAI,CAAA;AACzE,CAAC"}
|
package/out/fr/region.d.ts
CHANGED
|
@@ -12,14 +12,22 @@
|
|
|
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
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Per-region record: ISO 3166-2:FR code (sans `FR-` prefix) + French name.
|
|
17
|
+
*/
|
|
16
18
|
export interface FrenchRegionInfo {
|
|
17
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* ISO 3166-2:FR region code without the `FR-` prefix (e.g. `IDF` for `FR-IDF`).
|
|
21
|
+
*/
|
|
18
22
|
code: string;
|
|
19
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* French name (e.g. `Île-de-France`).
|
|
25
|
+
*/
|
|
20
26
|
name: string;
|
|
21
27
|
}
|
|
22
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* ISO 3166-2:FR region code → info, for all 18 régions (13 metropolitan + 5 overseas).
|
|
30
|
+
*/
|
|
23
31
|
export declare const FR_REGIONS: {
|
|
24
32
|
readonly ARA: {
|
|
25
33
|
readonly code: "ARA";
|
|
@@ -94,9 +102,13 @@ export declare const FR_REGIONS: {
|
|
|
94
102
|
readonly name: "Mayotte";
|
|
95
103
|
};
|
|
96
104
|
};
|
|
97
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* An ISO 3166-2:FR region code (`ARA`, `IDF`, `PAC`, …).
|
|
107
|
+
*/
|
|
98
108
|
export type FrenchRegionCode = keyof typeof FR_REGIONS;
|
|
99
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Type-predicate for an ISO 3166-2:FR region code. Case-insensitive.
|
|
111
|
+
*/
|
|
100
112
|
export declare function isFrenchRegionCode(input: unknown): input is FrenchRegionCode;
|
|
101
113
|
/**
|
|
102
114
|
* Folded region name / code → ISO 3166-2:FR code. Built diacritic-insensitive so the resolver's surface form
|
package/out/fr/region.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"region.d.ts","sourceRoot":"","sources":["../../fr/region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH
|
|
1
|
+
{"version":3,"file":"region.d.ts","sourceRoot":"","sources":["../../fr/region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB8B,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,UAAU,CAAA;AAItD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E;AAcD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CASrE,CAAA;AAEJ;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,GAAG,IAAI,CAO5F"}
|
package/out/fr/region.js
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
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
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* ISO 3166-2:FR region code → info, for all 18 régions (13 metropolitan + 5 overseas).
|
|
17
|
+
*/
|
|
16
18
|
export const FR_REGIONS = {
|
|
17
19
|
ARA: { code: "ARA", name: "Auvergne-Rhône-Alpes" },
|
|
18
20
|
BFC: { code: "BFC", name: "Bourgogne-Franche-Comté" },
|
|
@@ -34,17 +36,21 @@ export const FR_REGIONS = {
|
|
|
34
36
|
MAY: { code: "MAY", name: "Mayotte" },
|
|
35
37
|
};
|
|
36
38
|
const REGION_CODE_SET = new Set(Object.keys(FR_REGIONS));
|
|
37
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Type-predicate for an ISO 3166-2:FR region code. Case-insensitive.
|
|
41
|
+
*/
|
|
38
42
|
export function isFrenchRegionCode(input) {
|
|
39
43
|
return typeof input === "string" && REGION_CODE_SET.has(input.toUpperCase());
|
|
40
44
|
}
|
|
41
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Strip diacritics + lowercase so `Île-de-France`, `ile-de-france`, `Ile de France` all key alike.
|
|
47
|
+
*/
|
|
42
48
|
function foldName(s) {
|
|
43
49
|
return s
|
|
44
50
|
.toLowerCase()
|
|
45
51
|
.normalize("NFD")
|
|
46
|
-
.
|
|
47
|
-
.
|
|
52
|
+
.replaceAll(/[\u0300-\u036F]/g, "")
|
|
53
|
+
.replaceAll(/[^a-z0-9]+/g, " ")
|
|
48
54
|
.trim();
|
|
49
55
|
}
|
|
50
56
|
/**
|
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;AAgBH;;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,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAC9C,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,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,WAAW,EAAE,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,GAAG,CAAA;AACX,CAAC,CAAC,EAAE,CAAA;AAEJ;;GAEG;AACH,MAAM,UAAU,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"}
|
package/out/fr/voie.d.ts
CHANGED
|
@@ -53,7 +53,9 @@ export declare const FR_VOIE_TYPES: {
|
|
|
53
53
|
readonly résidence: readonly ["rés"];
|
|
54
54
|
readonly lotissement: readonly ["lot"];
|
|
55
55
|
};
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* A canonical French voie type (e.g. `rue`, `avenue`, `boulevard`).
|
|
58
|
+
*/
|
|
57
59
|
export type FrenchVoieType = keyof typeof FR_VOIE_TYPES;
|
|
58
60
|
/**
|
|
59
61
|
* True when a token is a French voie type word or abbreviation (case- and accent-insensitive) — `Rue`, `BD`, `Allée`,
|
package/out/fr/voie.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voie.d.ts","sourceRoot":"","sources":["../../fr/voie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC4B,CAAA;AAEtD
|
|
1
|
+
{"version":3,"file":"voie.d.ts","sourceRoot":"","sources":["../../fr/voie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC4B,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,aAAa,CAAA;AA0BvD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAU1D"}
|
package/out/fr/voie.js
CHANGED
|
@@ -61,7 +61,7 @@ const VOIE_TOKEN_SET = (() => {
|
|
|
61
61
|
const fold = (s) => s
|
|
62
62
|
.toLowerCase()
|
|
63
63
|
.normalize("NFD")
|
|
64
|
-
.
|
|
64
|
+
.replaceAll(/[\u0300-\u036F]/g, "");
|
|
65
65
|
const out = new Set();
|
|
66
66
|
for (const canonical of Object.keys(FR_VOIE_TYPES)) {
|
|
67
67
|
out.add(fold(canonical));
|
|
@@ -82,8 +82,8 @@ export function isFrenchStreetWord(token) {
|
|
|
82
82
|
const t = token
|
|
83
83
|
.toLowerCase()
|
|
84
84
|
.normalize("NFD")
|
|
85
|
-
.
|
|
86
|
-
.
|
|
85
|
+
.replaceAll(/[\u0300-\u036F]/g, "")
|
|
86
|
+
.replaceAll(/[^a-z-]/g, "");
|
|
87
87
|
return t.length > 0 && VOIE_TOKEN_SET.has(t);
|
|
88
88
|
}
|
|
89
89
|
//# sourceMappingURL=voie.js.map
|
package/out/fr/voie.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voie.js","sourceRoot":"","sources":["../../fr/voie.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,GAAG,EAAE,CAAC,GAAG,CAAC;IACV,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,CAAC,IAAI,CAAC;IACb,O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xE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;QAExB,KAAK,MAAM,IAAI,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACpB,CAAC;IACF,CAAC;IAED,OAAO,GAAG,CAAA;AACX,CAAC,CAAC,EAAE,CAAA;AAEJ;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAE3C,MAAM,CAAC,GAAG,KAAK;SACb,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAClC,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAE5B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAC7C,CAAC"}
|
package/out/gb/country.d.ts
CHANGED
|
@@ -13,14 +13,22 @@
|
|
|
13
13
|
* postcode area (see `postcode-area.ts`). So this file is the coarse admin label, and the
|
|
14
14
|
* postcode is the thing that actually carries the geography.
|
|
15
15
|
*/
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Per-country record: ISO 3166-2:GB code (sans `GB-` prefix) + English name.
|
|
18
|
+
*/
|
|
17
19
|
export interface UkCountryInfo {
|
|
18
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* ISO 3166-2:GB country code without the `GB-` prefix (e.g. `ENG` for `GB-ENG`).
|
|
22
|
+
*/
|
|
19
23
|
code: string;
|
|
20
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* English name (e.g. `Scotland`).
|
|
26
|
+
*/
|
|
21
27
|
name: string;
|
|
22
28
|
}
|
|
23
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* ISO 3166-2:GB country code → info, for all four constituent countries.
|
|
31
|
+
*/
|
|
24
32
|
export declare const GB_COUNTRIES: {
|
|
25
33
|
readonly ENG: {
|
|
26
34
|
readonly code: "ENG";
|
|
@@ -39,9 +47,13 @@ export declare const GB_COUNTRIES: {
|
|
|
39
47
|
readonly name: "Northern Ireland";
|
|
40
48
|
};
|
|
41
49
|
};
|
|
42
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* An ISO 3166-2:GB constituent-country code (`ENG`, `SCT`, `WLS`, `NIR`).
|
|
52
|
+
*/
|
|
43
53
|
export type UkCountryCode = keyof typeof GB_COUNTRIES;
|
|
44
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Type-predicate for an ISO 3166-2:GB country code. Case-insensitive.
|
|
56
|
+
*/
|
|
45
57
|
export declare function isUkCountryCode(input: unknown): input is UkCountryCode;
|
|
46
58
|
/**
|
|
47
59
|
* Resolve a UK constituent-country surface form (ISO code or English name) to its ISO code; null if unknown. Accepts
|
package/out/gb/country.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country.d.ts","sourceRoot":"","sources":["../../gb/country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH
|
|
1
|
+
{"version":3,"file":"country.d.ts","sourceRoot":"","sources":["../../gb/country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;CAKyB,CAAA;AAElD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,YAAY,CAAA;AAIrD;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AA0BD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,aAAa,GAAG,IAAI,CAOtF"}
|
package/out/gb/country.js
CHANGED
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
* postcode area (see `postcode-area.ts`). So this file is the coarse admin label, and the
|
|
14
14
|
* postcode is the thing that actually carries the geography.
|
|
15
15
|
*/
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* ISO 3166-2:GB country code → info, for all four constituent countries.
|
|
18
|
+
*/
|
|
17
19
|
export const GB_COUNTRIES = {
|
|
18
20
|
ENG: { code: "ENG", name: "England" },
|
|
19
21
|
SCT: { code: "SCT", name: "Scotland" },
|
|
@@ -21,18 +23,24 @@ export const GB_COUNTRIES = {
|
|
|
21
23
|
NIR: { code: "NIR", name: "Northern Ireland" },
|
|
22
24
|
};
|
|
23
25
|
const COUNTRY_CODE_SET = new Set(Object.keys(GB_COUNTRIES));
|
|
24
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Type-predicate for an ISO 3166-2:GB country code. Case-insensitive.
|
|
28
|
+
*/
|
|
25
29
|
export function isUkCountryCode(input) {
|
|
26
30
|
return typeof input === "string" && COUNTRY_CODE_SET.has(input.toUpperCase());
|
|
27
31
|
}
|
|
28
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Lowercase + collapse non-alphanumerics so `Northern Ireland`, `northern-ireland` key alike.
|
|
34
|
+
*/
|
|
29
35
|
function foldName(s) {
|
|
30
36
|
return s
|
|
31
37
|
.toLowerCase()
|
|
32
|
-
.
|
|
38
|
+
.replaceAll(/[^a-z0-9]+/g, " ")
|
|
33
39
|
.trim();
|
|
34
40
|
}
|
|
35
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Folded country name / code → ISO 3166-2:GB code, so a surface form maps regardless of casing.
|
|
43
|
+
*/
|
|
36
44
|
const COUNTRY_NAME_TO_CODE = (() => {
|
|
37
45
|
const out = new Map();
|
|
38
46
|
for (const code of Object.keys(GB_COUNTRIES)) {
|
package/out/gb/country.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country.js","sourceRoot":"","sources":["../../gb/country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"country.js","sourceRoot":"","sources":["../../gb/country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;IACrC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;IACnC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE;CACG,CAAA;AAOlD,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAA;AAEhF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;AAC9E,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC;SACN,WAAW,EAAE;SACb,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;SAC9B,IAAI,EAAE,CAAA;AACT,CAAC;AAED;;GAEG;AACH,MAAM,oBAAoB,GAAuC,CAAC,GAAG,EAAE;IACtE,MAAM,GAAG,GAAG,IAAI,GAAG,EAAyB,CAAA;IAE5C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAoB,EAAE,CAAC;QACjE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QAChD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,GAAG,CAAA;AACX,CAAC,CAAC,EAAE,CAAA;AAEJ;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAgC;IAC/D,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,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,KAAsB,CAAA;IAE9D,OAAO,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAA;AACzD,CAAC"}
|
|
@@ -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;
|
|
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;AASD;;;;;;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
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
* non-England set with documented border fudges — rather than a tidy prefix rule — is exactly why
|
|
22
22
|
* a UK postcode is not a county.
|
|
23
23
|
*/
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Northern Ireland is a single postcode area: BT (Belfast).
|
|
26
|
+
*/
|
|
25
27
|
const NORTHERN_IRELAND_AREAS = ["BT"];
|
|
26
28
|
/**
|
|
27
29
|
* Scotland's postcode areas. TD (Galashiels) straddles the border with England and is assigned to Scotland as its
|
|
@@ -67,7 +69,9 @@ export const GB_POSTCODE_AREA_COUNTRY = {
|
|
|
67
69
|
...Object.fromEntries(SCOTLAND_AREAS.map((a) => [a, "SCT"])),
|
|
68
70
|
...Object.fromEntries(WALES_AREAS.map((a) => [a, "WLS"])),
|
|
69
71
|
};
|
|
70
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* True when `area` looks like a valid postcode-area string: one or two ASCII letters.
|
|
74
|
+
*/
|
|
71
75
|
function isAreaShape(area) {
|
|
72
76
|
return typeof area === "string" && /^[A-Z]{1,2}$/i.test(area);
|
|
73
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-area.js","sourceRoot":"","sources":["../../gb/postcode-area.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH
|
|
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,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AC,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/gb/postcode.d.ts
CHANGED
|
@@ -27,16 +27,6 @@
|
|
|
27
27
|
* internal space, and cleaving outward from inward — not a prefix→admin lookup.
|
|
28
28
|
*/
|
|
29
29
|
import type { Tagged } from "type-fest";
|
|
30
|
-
/**
|
|
31
|
-
* A UK postcode: variable-length alphanumeric, outward + inward (`SW1A 1AA`, `M1 1AE`). The canonical form carries
|
|
32
|
-
* exactly one space before the final three characters. Unlike a US/DE/FR postcode, the shape is not a fixed-width
|
|
33
|
-
* numeric string — see {@link UK_POSTCODE_PATTERN}.
|
|
34
|
-
*
|
|
35
|
-
* @category Postal
|
|
36
|
-
* @type string
|
|
37
|
-
* @title UK postcode
|
|
38
|
-
* @pattern ^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$
|
|
39
|
-
*/
|
|
40
30
|
export type Postcode = Tagged<string, "UkPostcode">;
|
|
41
31
|
/**
|
|
42
32
|
* UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters (the area), a
|
|
@@ -51,7 +41,9 @@ export declare const UK_POSTCODE_PATTERN: RegExp;
|
|
|
51
41
|
* Returns null if the result is not a valid postcode.
|
|
52
42
|
*/
|
|
53
43
|
export declare function normalizeUkPostcode(raw: unknown): Postcode | null;
|
|
54
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Type-predicate for a UK postcode surface form (space optional).
|
|
46
|
+
*/
|
|
55
47
|
export declare function isUkPostcode(input: unknown): input is Postcode;
|
|
56
48
|
/**
|
|
57
49
|
* The OUTWARD code — the part before the space (area + district), e.g. `SW1A 1AA` → `SW1A`, `M1 1AE` → `M1`. Normalizes
|
package/out/gb/postcode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode.d.ts","sourceRoot":"","sources":["../../gb/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"postcode.d.ts","sourceRoot":"","sources":["../../gb/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAiBvC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAAwC,CAAA;AAExE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CASjE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE9D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAMtD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAMrD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOvD"}
|
package/out/gb/postcode.js
CHANGED
|
@@ -26,6 +26,20 @@
|
|
|
26
26
|
* So unlike the other systems, the hard work here is the shape itself — validating, normalizing the
|
|
27
27
|
* internal space, and cleaving outward from inward — not a prefix→admin lookup.
|
|
28
28
|
*/
|
|
29
|
+
/**
|
|
30
|
+
* A UK postcode: variable-length alphanumeric, outward + inward (`SW1A 1AA`, `M1 1AE`). The canonical form carries
|
|
31
|
+
* exactly one space before the final three characters. Unlike a US/DE/FR postcode, the shape is not a fixed-width
|
|
32
|
+
* numeric string — see {@link UK_POSTCODE_PATTERN}.
|
|
33
|
+
*
|
|
34
|
+
* @category Postal
|
|
35
|
+
* @type string
|
|
36
|
+
* @title UK postcode
|
|
37
|
+
* @pattern ^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Shortest valid UK postcode once spaces are stripped, e.g. `M11AE`.
|
|
41
|
+
*/
|
|
42
|
+
const MIN_POSTCODE_LENGTH = 5;
|
|
29
43
|
/**
|
|
30
44
|
* UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters (the area), a
|
|
31
45
|
* district digit, an optional district letter-or-digit, then the inward sector digit and two unit letters, with the
|
|
@@ -42,13 +56,15 @@ export function normalizeUkPostcode(raw) {
|
|
|
42
56
|
if (typeof raw !== "string")
|
|
43
57
|
return null;
|
|
44
58
|
// Drop all whitespace, uppercase, then re-insert the single canonical space before the inward 3.
|
|
45
|
-
const compact = raw.
|
|
46
|
-
if (compact.length <
|
|
59
|
+
const compact = raw.replaceAll(/\s+/g, "").toUpperCase();
|
|
60
|
+
if (compact.length < MIN_POSTCODE_LENGTH)
|
|
47
61
|
return null;
|
|
48
62
|
const spaced = `${compact.slice(0, -3)} ${compact.slice(-3)}`;
|
|
49
63
|
return UK_POSTCODE_PATTERN.test(spaced) ? spaced : null;
|
|
50
64
|
}
|
|
51
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Type-predicate for a UK postcode surface form (space optional).
|
|
67
|
+
*/
|
|
52
68
|
export function isUkPostcode(input) {
|
|
53
69
|
return typeof input === "string" && UK_POSTCODE_PATTERN.test(input.trim());
|
|
54
70
|
}
|
package/out/gb/postcode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode.js","sourceRoot":"","sources":["../../gb/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;
|
|
1
|
+
{"version":3,"file":"postcode.js","sourceRoot":"","sources":["../../gb/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH;;;;;;;;;GASG;AACH;;GAEG;AACH,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAI7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,qCAAqC,CAAA;AAExE;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IACxC,iGAAiG;IACjG,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;IAExD,IAAI,OAAO,CAAC,MAAM,GAAG,mBAAmB;QAAE,OAAO,IAAI,CAAA;IACrD,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAE7D,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,MAAmB,CAAC,CAAC,CAAC,IAAI,CAAA;AACtE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;AAC3E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAW;IACtC,MAAM,UAAU,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAA;IAE1C,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAA;IAE5B,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,EAAW;IACrC,MAAM,UAAU,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAA;IAE1C,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAA;IAE5B,OAAO,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,EAAW;IACvC,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;IAE/B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IACzB,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAEzC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC/B,CAAC"}
|
package/out/gb/street-type.d.ts
CHANGED
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
* the regional/landscape tail (`wynd`, `brae`, `gait`, `croft`, `dene`, `spinney`, `dell`, `hollow`).
|
|
25
25
|
*/
|
|
26
26
|
export declare const GB_STREET_TYPES: readonly ["street", "road", "lane", "avenue", "close", "crescent", "court", "drive", "place", "way", "gardens", "grove", "terrace", "mews", "walk", "hill", "green", "park", "rise", "view", "row", "square", "parade", "vale", "wharf", "yard", "gate", "croft", "dene", "end", "fields", "meadow", "brook", "chase", "copse", "dale", "dell", "glen", "hollow", "paddock", "ridge", "spinney", "wynd", "brae", "gait"];
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A canonical British thoroughfare word (e.g. `street`, `crescent`, `mews`).
|
|
29
|
+
*/
|
|
28
30
|
export type BritishStreetType = (typeof GB_STREET_TYPES)[number];
|
|
29
31
|
/**
|
|
30
32
|
* True when a token is a British thoroughfare type word (case-insensitive, whole-token match) — `Crescent`, `Mews`,
|