@mailwoman/codex 4.16.1 → 5.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.
Files changed (141) hide show
  1. package/out/address-system-conventions.d.ts +5 -5
  2. package/out/address-system-conventions.d.ts.map +1 -1
  3. package/out/address-system-conventions.js +15 -18
  4. package/out/address-system-conventions.js.map +1 -1
  5. package/out/au/delivery-service.d.ts +13 -16
  6. package/out/au/delivery-service.d.ts.map +1 -1
  7. package/out/au/delivery-service.js +13 -15
  8. package/out/au/delivery-service.js.map +1 -1
  9. package/out/au/level-designator.d.ts +20 -21
  10. package/out/au/level-designator.d.ts.map +1 -1
  11. package/out/au/level-designator.js +15 -15
  12. package/out/au/level-designator.js.map +1 -1
  13. package/out/au/postcode.d.ts.map +1 -1
  14. package/out/au/postcode.js.map +1 -1
  15. package/out/ca/postal-code.d.ts +18 -20
  16. package/out/ca/postal-code.d.ts.map +1 -1
  17. package/out/ca/postal-code.js +15 -17
  18. package/out/ca/postal-code.js.map +1 -1
  19. package/out/ca/province.d.ts +8 -8
  20. package/out/ca/province.d.ts.map +1 -1
  21. package/out/ca/province.js +8 -8
  22. package/out/ca/province.js.map +1 -1
  23. package/out/ca/street-type.d.ts +15 -17
  24. package/out/ca/street-type.d.ts.map +1 -1
  25. package/out/ca/street-type.js +15 -17
  26. package/out/ca/street-type.js.map +1 -1
  27. package/out/country/country.d.ts +12 -13
  28. package/out/country/country.d.ts.map +1 -1
  29. package/out/country/country.js +17 -15
  30. package/out/country/country.js.map +1 -1
  31. package/out/country/names.d.ts +1 -1
  32. package/out/country/names.js +1 -1
  33. package/out/country/reference-data.d.ts +1 -1
  34. package/out/country/reference-data.js +1 -1
  35. package/out/country/reference.d.ts +4 -4
  36. package/out/country/reference.d.ts.map +1 -1
  37. package/out/country/reference.js +4 -4
  38. package/out/country/reference.js.map +1 -1
  39. package/out/de/bundesland.d.ts +8 -8
  40. package/out/de/bundesland.d.ts.map +1 -1
  41. package/out/de/bundesland.js +8 -8
  42. package/out/de/bundesland.js.map +1 -1
  43. package/out/de/postleitzahl.d.ts +7 -9
  44. package/out/de/postleitzahl.d.ts.map +1 -1
  45. package/out/de/postleitzahl.js +5 -7
  46. package/out/de/postleitzahl.js.map +1 -1
  47. package/out/de/street-type.d.ts +9 -10
  48. package/out/de/street-type.d.ts.map +1 -1
  49. package/out/de/street-type.js +9 -10
  50. package/out/de/street-type.js.map +1 -1
  51. package/out/fr/cedex.d.ts +2 -3
  52. package/out/fr/cedex.d.ts.map +1 -1
  53. package/out/fr/cedex.js +2 -3
  54. package/out/fr/cedex.js.map +1 -1
  55. package/out/fr/code-postal.d.ts +8 -11
  56. package/out/fr/code-postal.d.ts.map +1 -1
  57. package/out/fr/code-postal.js +6 -9
  58. package/out/fr/code-postal.js.map +1 -1
  59. package/out/fr/departement.d.ts +1 -2
  60. package/out/fr/departement.d.ts.map +1 -1
  61. package/out/fr/departement.js +1 -2
  62. package/out/fr/departement.js.map +1 -1
  63. package/out/fr/region.d.ts +5 -6
  64. package/out/fr/region.d.ts.map +1 -1
  65. package/out/fr/region.js +5 -6
  66. package/out/fr/region.js.map +1 -1
  67. package/out/fr/voie.d.ts +5 -5
  68. package/out/fr/voie.d.ts.map +1 -1
  69. package/out/fr/voie.js +7 -7
  70. package/out/fr/voie.js.map +1 -1
  71. package/out/gb/country.d.ts +2 -2
  72. package/out/gb/country.d.ts.map +1 -1
  73. package/out/gb/country.js +2 -2
  74. package/out/gb/country.js.map +1 -1
  75. package/out/gb/postcode-area.d.ts +10 -12
  76. package/out/gb/postcode-area.d.ts.map +1 -1
  77. package/out/gb/postcode-area.js +14 -16
  78. package/out/gb/postcode-area.js.map +1 -1
  79. package/out/gb/postcode.d.ts +17 -18
  80. package/out/gb/postcode.d.ts.map +1 -1
  81. package/out/gb/postcode.js +14 -15
  82. package/out/gb/postcode.js.map +1 -1
  83. package/out/gb/street-type.d.ts +6 -7
  84. package/out/gb/street-type.d.ts.map +1 -1
  85. package/out/gb/street-type.js +6 -7
  86. package/out/gb/street-type.js.map +1 -1
  87. package/out/jp/address-unit.d.ts +8 -9
  88. package/out/jp/address-unit.d.ts.map +1 -1
  89. package/out/jp/address-unit.js +8 -9
  90. package/out/jp/address-unit.js.map +1 -1
  91. package/out/jp/postal-code.d.ts +12 -15
  92. package/out/jp/postal-code.d.ts.map +1 -1
  93. package/out/jp/postal-code.js +9 -12
  94. package/out/jp/postal-code.js.map +1 -1
  95. package/out/jp/prefecture.d.ts +7 -7
  96. package/out/jp/prefecture.d.ts.map +1 -1
  97. package/out/jp/prefecture.js +15 -16
  98. package/out/jp/prefecture.js.map +1 -1
  99. package/out/nz/delivery-service.d.ts +28 -31
  100. package/out/nz/delivery-service.d.ts.map +1 -1
  101. package/out/nz/delivery-service.js +25 -29
  102. package/out/nz/delivery-service.js.map +1 -1
  103. package/out/nz/postcode.d.ts.map +1 -1
  104. package/out/nz/postcode.js.map +1 -1
  105. package/out/postcode-systems.d.ts +3 -3
  106. package/out/postcode-systems.d.ts.map +1 -1
  107. package/out/postcode-systems.js +6 -7
  108. package/out/postcode-systems.js.map +1 -1
  109. package/out/us/floor-designator.d.ts +15 -18
  110. package/out/us/floor-designator.d.ts.map +1 -1
  111. package/out/us/floor-designator.js +11 -13
  112. package/out/us/floor-designator.js.map +1 -1
  113. package/out/us/military-address.d.ts +16 -17
  114. package/out/us/military-address.d.ts.map +1 -1
  115. package/out/us/military-address.js +16 -17
  116. package/out/us/military-address.js.map +1 -1
  117. package/out/us/po-box.d.ts +12 -12
  118. package/out/us/po-box.d.ts.map +1 -1
  119. package/out/us/po-box.js +12 -12
  120. package/out/us/po-box.js.map +1 -1
  121. package/out/us/state.d.ts +7 -8
  122. package/out/us/state.d.ts.map +1 -1
  123. package/out/us/state.js +7 -8
  124. package/out/us/state.js.map +1 -1
  125. package/out/us/street-directional.d.ts +9 -11
  126. package/out/us/street-directional.d.ts.map +1 -1
  127. package/out/us/street-directional.js +9 -11
  128. package/out/us/street-directional.js.map +1 -1
  129. package/out/us/street-suffix.d.ts +10 -15
  130. package/out/us/street-suffix.d.ts.map +1 -1
  131. package/out/us/street-suffix.js +8 -11
  132. package/out/us/street-suffix.js.map +1 -1
  133. package/out/us/unit-designator.d.ts +12 -15
  134. package/out/us/unit-designator.d.ts.map +1 -1
  135. package/out/us/unit-designator.js +10 -13
  136. package/out/us/unit-designator.js.map +1 -1
  137. package/out/us/zipcode.d.ts +16 -19
  138. package/out/us/zipcode.d.ts.map +1 -1
  139. package/out/us/zipcode.js +6 -6
  140. package/out/us/zipcode.js.map +1 -1
  141. package/package.json +11 -11
@@ -24,8 +24,8 @@
24
24
  /** Northern Ireland is a single postcode area: BT (Belfast). */
25
25
  const NORTHERN_IRELAND_AREAS = ["BT"];
26
26
  /**
27
- * Scotland's postcode areas. TD (Galashiels) straddles the border with England and is assigned to
28
- * Scotland as its majority country.
27
+ * Scotland's postcode areas. TD (Galashiels) straddles the border with England and is assigned to Scotland as its
28
+ * majority country.
29
29
  */
30
30
  const SCOTLAND_AREAS = [
31
31
  "AB", // Aberdeen
@@ -46,8 +46,8 @@ const SCOTLAND_AREAS = [
46
46
  "ZE", // Lerwick (Shetland)
47
47
  ];
48
48
  /**
49
- * Wales's postcode areas. SY (Shrewsbury) straddles the border with England and is assigned to
50
- * Wales as its majority country.
49
+ * Wales's postcode areas. SY (Shrewsbury) straddles the border with England and is assigned to Wales as its majority
50
+ * country.
51
51
  */
52
52
  const WALES_AREAS = [
53
53
  "CF", // Cardiff
@@ -58,10 +58,9 @@ const WALES_AREAS = [
58
58
  "SY", // Shrewsbury — straddles the Wales/England border, majority Wales
59
59
  ];
60
60
  /**
61
- * The explicit non-England postcode areas, area → constituent country. England is intentionally
62
- * absent: it is the DEFAULT (the great majority of UK areas are English), so listing it would be
63
- * both enormous and a maintenance trap. Keeping only the non-England set makes the default
64
- * transparent — anything not named here is England.
61
+ * The explicit non-England postcode areas, area → constituent country. England is intentionally absent: it is the
62
+ * DEFAULT (the great majority of UK areas are English), so listing it would be both enormous and a maintenance trap.
63
+ * Keeping only the non-England set makes the default transparent — anything not named here is England.
65
64
  */
66
65
  export const GB_POSTCODE_AREA_COUNTRY = {
67
66
  ...Object.fromEntries(NORTHERN_IRELAND_AREAS.map((a) => [a, "NIR"])),
@@ -73,11 +72,11 @@ function isAreaShape(area) {
73
72
  return typeof area === "string" && /^[A-Z]{1,2}$/i.test(area);
74
73
  }
75
74
  /**
76
- * The constituent country a postcode AREA belongs to. Returns the explicit country for a known
77
- * non-England area (e.g. `BT` → `NIR`, `G` → `SCT`, `CF` → `WLS`), and `ENG` as the default for any
78
- * other validly-shaped area — England is by far the largest, so the default is transparent and the
79
- * non-England exceptions live in {@link GB_POSTCODE_AREA_COUNTRY}. Returns null for clearly-invalid
80
- * input (not one-or-two letters), so a malformed token is not silently called England.
75
+ * The constituent country a postcode AREA belongs to. Returns the explicit country for a known non-England area (e.g.
76
+ * `BT` → `NIR`, `G` → `SCT`, `CF` → `WLS`), and `ENG` as the default for any other validly-shaped area — England is by
77
+ * far the largest, so the default is transparent and the non-England exceptions live in
78
+ * {@link GB_POSTCODE_AREA_COUNTRY}. Returns null for clearly-invalid input (not one-or-two letters), so a malformed
79
+ * token is not silently called England.
81
80
  */
82
81
  export function countryOfPostcodeArea(area) {
83
82
  if (!isAreaShape(area))
@@ -85,9 +84,8 @@ export function countryOfPostcodeArea(area) {
85
84
  return GB_POSTCODE_AREA_COUNTRY[area.toUpperCase()] ?? "ENG";
86
85
  }
87
86
  /**
88
- * The constituent country a whole postcode resolves to, by extracting its area. `BT1 1AA` → `NIR`,
89
- * `EH1 1BB` → `SCT`, `CF10 1AA` → `WLS`, `SW1A 1AA` → `ENG`. Null if the input has no extractable
90
- * postcode area.
87
+ * The constituent country a whole postcode resolves to, by extracting its area. `BT1 1AA` → `NIR`, `EH1 1BB` → `SCT`,
88
+ * `CF10 1AA` → `WLS`, `SW1A 1AA` → `ENG`. Null if the input has no extractable postcode area.
91
89
  */
92
90
  export function countryOfPostcode(postcode) {
93
91
  if (typeof postcode !== "string")
@@ -1 +1 @@
1
- {"version":3,"file":"postcode-area.js","sourceRoot":"","sources":["../../gb/postcode-area.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,gEAAgE;AAChE,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;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkC;IACtE,GAAG,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAc,CAAC,CAAC,CAAC;IAC7E,GAAG,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAc,CAAC,CAAC,CAAC;IACrE,GAAG,MAAM,CAAC,WAAW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AU,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"}
@@ -28,9 +28,9 @@
28
28
  */
29
29
  import type { Tagged } from "type-fest";
30
30
  /**
31
- * A UK postcode: variable-length alphanumeric, outward + inward (`SW1A 1AA`, `M1 1AE`). The
32
- * canonical form carries exactly one space before the final three characters. Unlike a US/DE/FR
33
- * postcode, the shape is not a fixed-width numeric string — see {@link UK_POSTCODE_PATTERN}.
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
34
  *
35
35
  * @category Postal
36
36
  * @type string
@@ -39,35 +39,34 @@ import type { Tagged } from "type-fest";
39
39
  */
40
40
  export type Postcode = Tagged<string, "UkPostcode">;
41
41
  /**
42
- * UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters
43
- * (the area), a district digit, an optional district letter-or-digit, then the inward sector digit
44
- * and two unit letters, with the inward space optional so an un-spaced `SW1A1AA` still validates.
45
- * The full UK-gov pattern additionally whitelists the British Overseas Territory codes (`ASCN`,
46
- * `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
42
+ * UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters (the area), a
43
+ * district digit, an optional district letter-or-digit, then the inward sector digit and two unit letters, with the
44
+ * inward space optional so an un-spaced `SW1A1AA` still validates. The full UK-gov pattern additionally whitelists the
45
+ * British Overseas Territory codes (`ASCN`, `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
47
46
  */
48
47
  export declare const UK_POSTCODE_PATTERN: RegExp;
49
48
  /**
50
- * Normalize a UK postcode surface form: uppercase, strip surrounding whitespace, and ensure exactly
51
- * one space before the final three characters (the inward code). `sw1a1aa` → `SW1A 1AA`, `M11AE` →
52
- * `M1 1AE`, `b33 8th` → `B33 8TH`. Returns null if the result is not a valid postcode.
49
+ * Normalize a UK postcode surface form: uppercase, strip surrounding whitespace, and ensure exactly one space before
50
+ * the final three characters (the inward code). `sw1a1aa` → `SW1A 1AA`, `M11AE` → `M1 1AE`, `b33 8th` → `B33 8TH`.
51
+ * Returns null if the result is not a valid postcode.
53
52
  */
54
53
  export declare function normalizeUkPostcode(raw: unknown): Postcode | null;
55
54
  /** Type-predicate for a UK postcode surface form (space optional). */
56
55
  export declare function isUkPostcode(input: unknown): input is Postcode;
57
56
  /**
58
- * The OUTWARD code — the part before the space (area + district), e.g. `SW1A 1AA` → `SW1A`, `M1
59
- * 1AE` → `M1`. Normalizes first so an un-spaced input still cleaves correctly; null if invalid.
57
+ * The OUTWARD code — the part before the space (area + district), e.g. `SW1A 1AA` → `SW1A`, `M1 1AE` → `M1`. Normalizes
58
+ * first so an un-spaced input still cleaves correctly; null if invalid.
60
59
  */
61
60
  export declare function outwardCode(pc: unknown): string | null;
62
61
  /**
63
- * The INWARD code — the three characters after the space (sector + unit), e.g. `SW1A 1AA` → `1AA`,
64
- * `M1 1AE` → `1AE`. Null if invalid.
62
+ * The INWARD code — the three characters after the space (sector + unit), e.g. `SW1A 1AA` → `1AA`, `M1 1AE` → `1AE`.
63
+ * Null if invalid.
65
64
  */
66
65
  export declare function inwardCode(pc: unknown): string | null;
67
66
  /**
68
- * The POSTCODE AREA — the leading one or two LETTERS of the outward code, the Royal Mail routing
69
- * region named after a sorting town: `SW1A 1AA` → `SW`, `M1 1AE` → `M`, `B33 8TH` → `B`. This is
70
- * the key into `postcode-area.ts`'s area→country map. Null if the input is not a valid postcode.
67
+ * The POSTCODE AREA — the leading one or two LETTERS of the outward code, the Royal Mail routing region named after a
68
+ * sorting town: `SW1A 1AA` → `SW`, `M1 1AE` → `M`, `B33 8TH` → `B`. This is the key into `postcode-area.ts`'s
69
+ * area→country map. Null if the input is not a valid postcode.
71
70
  */
72
71
  export declare function postcodeArea(pc: unknown): string | null;
73
72
  //# sourceMappingURL=postcode.d.ts.map
@@ -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;AAEvC;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAwC,CAAA;AAExE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAOjE;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE9D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAItD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAIrD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAKvD"}
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;AAEvC;;;;;;;;;GASG;AACH,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,sEAAsE;AACtE,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"}
@@ -27,17 +27,16 @@
27
27
  * internal space, and cleaving outward from inward — not a prefix→admin lookup.
28
28
  */
29
29
  /**
30
- * UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters
31
- * (the area), a district digit, an optional district letter-or-digit, then the inward sector digit
32
- * and two unit letters, with the inward space optional so an un-spaced `SW1A1AA` still validates.
33
- * The full UK-gov pattern additionally whitelists the British Overseas Territory codes (`ASCN`,
34
- * `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
30
+ * UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters (the area), a
31
+ * district digit, an optional district letter-or-digit, then the inward sector digit and two unit letters, with the
32
+ * inward space optional so an un-spaced `SW1A1AA` still validates. The full UK-gov pattern additionally whitelists the
33
+ * British Overseas Territory codes (`ASCN`, `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
35
34
  */
36
35
  export const UK_POSTCODE_PATTERN = /^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$/i;
37
36
  /**
38
- * Normalize a UK postcode surface form: uppercase, strip surrounding whitespace, and ensure exactly
39
- * one space before the final three characters (the inward code). `sw1a1aa` → `SW1A 1AA`, `M11AE` →
40
- * `M1 1AE`, `b33 8th` → `B33 8TH`. Returns null if the result is not a valid postcode.
37
+ * Normalize a UK postcode surface form: uppercase, strip surrounding whitespace, and ensure exactly one space before
38
+ * the final three characters (the inward code). `sw1a1aa` → `SW1A 1AA`, `M11AE` → `M1 1AE`, `b33 8th` → `B33 8TH`.
39
+ * Returns null if the result is not a valid postcode.
41
40
  */
42
41
  export function normalizeUkPostcode(raw) {
43
42
  if (typeof raw !== "string")
@@ -54,8 +53,8 @@ export function isUkPostcode(input) {
54
53
  return typeof input === "string" && UK_POSTCODE_PATTERN.test(input.trim());
55
54
  }
56
55
  /**
57
- * The OUTWARD code — the part before the space (area + district), e.g. `SW1A 1AA` → `SW1A`, `M1
58
- * 1AE` → `M1`. Normalizes first so an un-spaced input still cleaves correctly; null if invalid.
56
+ * The OUTWARD code — the part before the space (area + district), e.g. `SW1A 1AA` → `SW1A`, `M1 1AE` → `M1`. Normalizes
57
+ * first so an un-spaced input still cleaves correctly; null if invalid.
59
58
  */
60
59
  export function outwardCode(pc) {
61
60
  const normalized = normalizeUkPostcode(pc);
@@ -64,8 +63,8 @@ export function outwardCode(pc) {
64
63
  return normalized.slice(0, normalized.indexOf(" "));
65
64
  }
66
65
  /**
67
- * The INWARD code — the three characters after the space (sector + unit), e.g. `SW1A 1AA` → `1AA`,
68
- * `M1 1AE` → `1AE`. Null if invalid.
66
+ * The INWARD code — the three characters after the space (sector + unit), e.g. `SW1A 1AA` → `1AA`, `M1 1AE` → `1AE`.
67
+ * Null if invalid.
69
68
  */
70
69
  export function inwardCode(pc) {
71
70
  const normalized = normalizeUkPostcode(pc);
@@ -74,9 +73,9 @@ export function inwardCode(pc) {
74
73
  return normalized.slice(normalized.indexOf(" ") + 1);
75
74
  }
76
75
  /**
77
- * The POSTCODE AREA — the leading one or two LETTERS of the outward code, the Royal Mail routing
78
- * region named after a sorting town: `SW1A 1AA` → `SW`, `M1 1AE` → `M`, `B33 8TH` → `B`. This is
79
- * the key into `postcode-area.ts`'s area→country map. Null if the input is not a valid postcode.
76
+ * The POSTCODE AREA — the leading one or two LETTERS of the outward code, the Royal Mail routing region named after a
77
+ * sorting town: `SW1A 1AA` → `SW`, `M1 1AE` → `M`, `B33 8TH` → `B`. This is the key into `postcode-area.ts`'s
78
+ * area→country map. Null if the input is not a valid postcode.
80
79
  */
81
80
  export function postcodeArea(pc) {
82
81
  const outward = outwardCode(pc);
@@ -1 +1 @@
1
- {"version":3,"file":"postcode.js","sourceRoot":"","sources":["../../gb/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAgBH;;;;;;GAMG;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,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;IACrD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACnC,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC7D,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,MAAmB,CAAC,CAAC,CAAC,IAAI,CAAA;AACtE,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAA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zB,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"}
@@ -19,18 +19,17 @@
19
19
  * distinct trailing words, not fused endings.
20
20
  */
21
21
  /**
22
- * The British thoroughfare vocabulary. Lowercase canonical forms, matched as whole tokens. Spans
23
- * the common core (`street`, `road`, `lane`, `avenue`) through the distinctively British
24
- * (`crescent`, `mews`, `close`, `terrace`) and the regional/landscape tail (`wynd`, `brae`, `gait`,
25
- * `croft`, `dene`, `spinney`, `dell`, `hollow`).
22
+ * The British thoroughfare vocabulary. Lowercase canonical forms, matched as whole tokens. Spans the common core
23
+ * (`street`, `road`, `lane`, `avenue`) through the distinctively British (`crescent`, `mews`, `close`, `terrace`) and
24
+ * the regional/landscape tail (`wynd`, `brae`, `gait`, `croft`, `dene`, `spinney`, `dell`, `hollow`).
26
25
  */
27
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"];
28
27
  /** A canonical British thoroughfare word (e.g. `street`, `crescent`, `mews`). */
29
28
  export type BritishStreetType = (typeof GB_STREET_TYPES)[number];
30
29
  /**
31
- * True when a token is a British thoroughfare type word (case-insensitive, whole-token match) —
32
- * `Crescent`, `Mews`, `Close`, `Road`. Matches the WHOLE token, not a suffix, so an unrelated place
33
- * name (`Tokyo`, `Bordeaux`) is not flagged the way an `-endsWith` test might.
30
+ * True when a token is a British thoroughfare type word (case-insensitive, whole-token match) — `Crescent`, `Mews`,
31
+ * `Close`, `Road`. Matches the WHOLE token, not a suffix, so an unrelated place name (`Tokyo`, `Bordeaux`) is not
32
+ * flagged the way an `-endsWith` test might.
34
33
  */
35
34
  export declare function isBritishStreetWord(token: unknown): boolean;
36
35
  //# sourceMappingURL=street-type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"street-type.d.ts","sourceRoot":"","sources":["../../gb/street-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,0ZA8ClB,CAAA;AAEV,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAIhE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI3D"}
1
+ {"version":3,"file":"street-type.d.ts","sourceRoot":"","sources":["../../gb/street-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe,0ZA8ClB,CAAA;AAEV,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAIhE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK3D"}
@@ -19,10 +19,9 @@
19
19
  * distinct trailing words, not fused endings.
20
20
  */
21
21
  /**
22
- * The British thoroughfare vocabulary. Lowercase canonical forms, matched as whole tokens. Spans
23
- * the common core (`street`, `road`, `lane`, `avenue`) through the distinctively British
24
- * (`crescent`, `mews`, `close`, `terrace`) and the regional/landscape tail (`wynd`, `brae`, `gait`,
25
- * `croft`, `dene`, `spinney`, `dell`, `hollow`).
22
+ * The British thoroughfare vocabulary. Lowercase canonical forms, matched as whole tokens. Spans the common core
23
+ * (`street`, `road`, `lane`, `avenue`) through the distinctively British (`crescent`, `mews`, `close`, `terrace`) and
24
+ * the regional/landscape tail (`wynd`, `brae`, `gait`, `croft`, `dene`, `spinney`, `dell`, `hollow`).
26
25
  */
27
26
  export const GB_STREET_TYPES = [
28
27
  "street",
@@ -73,9 +72,9 @@ export const GB_STREET_TYPES = [
73
72
  ];
74
73
  const STREET_TYPE_SET = new Set(GB_STREET_TYPES);
75
74
  /**
76
- * True when a token is a British thoroughfare type word (case-insensitive, whole-token match) —
77
- * `Crescent`, `Mews`, `Close`, `Road`. Matches the WHOLE token, not a suffix, so an unrelated place
78
- * name (`Tokyo`, `Bordeaux`) is not flagged the way an `-endsWith` test might.
75
+ * True when a token is a British thoroughfare type word (case-insensitive, whole-token match) — `Crescent`, `Mews`,
76
+ * `Close`, `Road`. Matches the WHOLE token, not a suffix, so an unrelated place name (`Tokyo`, `Bordeaux`) is not
77
+ * flagged the way an `-endsWith` test might.
79
78
  */
80
79
  export function isBritishStreetWord(token) {
81
80
  if (typeof token !== "string")
@@ -1 +1 @@
1
- {"version":3,"file":"street-type.js","sourceRoot":"","sources":["../../gb/street-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,QAAQ;IACR,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;IACP,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,KAAK;IACL,SAAS;IACT,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,MAAM;CACG,CAAA;AAKV,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,eAAe,CAAC,CAAA;AAErE;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IACpD,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC"}
1
+ {"version":3,"file":"street-type.js","sourceRoot":"","sources":["../../gb/street-type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,QAAQ;IACR,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;IACP,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,KAAK;IACL,SAAS;IACT,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,MAAM;CACG,CAAA;AAKV,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,eAAe,CAAC,CAAA;AAErE;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAEpD,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC"}
@@ -44,8 +44,8 @@ export declare const JP_ADMIN_SUFFIXES: readonly ["都", "道", "府", "県", "
44
44
  /** A single administrative-area suffix kanji (`都`, `市`, `区`, …). */
45
45
  export type JapaneseAdminSuffix = (typeof JP_ADMIN_SUFFIXES)[number];
46
46
  /**
47
- * The markers that close the numbered tail of an address — Japan's stand-in for a house number,
48
- * since there is no named street to hang one on:
47
+ * The markers that close the numbered tail of an address — Japan's stand-in for a house number, since there is no named
48
+ * street to hang one on:
49
49
  *
50
50
  * - 丁目 (chōme) — a district block within a neighbourhood.
51
51
  * - 番地 (banchi) — a lot number.
@@ -56,17 +56,16 @@ export declare const JP_BLOCK_MARKERS: readonly ["丁目", "番地", "番", "号
56
56
  /** A numbered-tail marker (`丁目`, `番地`, `番`, `号`). */
57
57
  export type JapaneseBlockMarker = (typeof JP_BLOCK_MARKERS)[number];
58
58
  /**
59
- * True when a single kanji is one of the {@link JP_ADMIN_SUFFIXES} admin-area markers (`都`, `市`,
60
- * `区`, …). Strictly single-character: a multi-character input (even one ending in a suffix) is not
61
- * a suffix on its own.
59
+ * True when a single kanji is one of the {@link JP_ADMIN_SUFFIXES} admin-area markers (`都`, `市`, `区`, …). Strictly
60
+ * single-character: a multi-character input (even one ending in a suffix) is not a suffix on its own.
62
61
  */
63
62
  export declare function isJapaneseAdminSuffix(ch: unknown): ch is JapaneseAdminSuffix;
64
63
  /**
65
- * Strip a trailing admin-area suffix kanji from a place name, exposing the bare name (`東京都` → `東京`,
66
- * `大阪市` → `大阪`, `千代田区` → `千代田`). Leaves a name untouched if it does not end in an admin suffix.
64
+ * Strip a trailing admin-area suffix kanji from a place name, exposing the bare name (`東京都` → `東京`, `大阪市` → `大阪`,
65
+ * `千代田区` → `千代田`). Leaves a name untouched if it does not end in an admin suffix.
67
66
  *
68
- * Hokkaido (`北海道`) is the deliberate exception: its name ends in 道 but is indivisible, so it is
69
- * returned whole rather than clipped to `北海` — mirroring the same carve-out in `prefecture.ts`.
67
+ * Hokkaido (`北海道`) is the deliberate exception: its name ends in 道 but is indivisible, so it is returned whole rather
68
+ * than clipped to `北海` — mirroring the same carve-out in `prefecture.ts`.
70
69
  */
71
70
  export declare function stripAdminSuffix(name: string): string;
72
71
  //# sourceMappingURL=address-unit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"address-unit.d.ts","sourceRoot":"","sources":["../../jp/address-unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,wDAAyD,CAAA;AAEvF,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,iCAAkC,CAAA;AAE/D,qDAAqD;AACrD,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAInE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,mBAAmB,CAE5E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrD"}
1
+ {"version":3,"file":"address-unit.d.ts","sourceRoot":"","sources":["../../jp/address-unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,wDAAyD,CAAA;AAEvF,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,iCAAkC,CAAA;AAE/D,qDAAqD;AACrD,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAInE;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,mBAAmB,CAE5E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOrD"}
@@ -42,8 +42,8 @@
42
42
  */
43
43
  export const JP_ADMIN_SUFFIXES = ["都", "道", "府", "県", "市", "区", "郡", "町", "村"];
44
44
  /**
45
- * The markers that close the numbered tail of an address — Japan's stand-in for a house number,
46
- * since there is no named street to hang one on:
45
+ * The markers that close the numbered tail of an address — Japan's stand-in for a house number, since there is no named
46
+ * street to hang one on:
47
47
  *
48
48
  * - 丁目 (chōme) — a district block within a neighbourhood.
49
49
  * - 番地 (banchi) — a lot number.
@@ -53,19 +53,18 @@ export const JP_ADMIN_SUFFIXES = ["都", "道", "府", "県", "市", "区", "郡
53
53
  export const JP_BLOCK_MARKERS = ["丁目", "番地", "番", "号"];
54
54
  const ADMIN_SUFFIX_SET = new Set(JP_ADMIN_SUFFIXES);
55
55
  /**
56
- * True when a single kanji is one of the {@link JP_ADMIN_SUFFIXES} admin-area markers (`都`, `市`,
57
- * `区`, …). Strictly single-character: a multi-character input (even one ending in a suffix) is not
58
- * a suffix on its own.
56
+ * True when a single kanji is one of the {@link JP_ADMIN_SUFFIXES} admin-area markers (`都`, `市`, `区`, …). Strictly
57
+ * single-character: a multi-character input (even one ending in a suffix) is not a suffix on its own.
59
58
  */
60
59
  export function isJapaneseAdminSuffix(ch) {
61
60
  return typeof ch === "string" && ADMIN_SUFFIX_SET.has(ch);
62
61
  }
63
62
  /**
64
- * Strip a trailing admin-area suffix kanji from a place name, exposing the bare name (`東京都` → `東京`,
65
- * `大阪市` → `大阪`, `千代田区` → `千代田`). Leaves a name untouched if it does not end in an admin suffix.
63
+ * Strip a trailing admin-area suffix kanji from a place name, exposing the bare name (`東京都` → `東京`, `大阪市` → `大阪`,
64
+ * `千代田区` → `千代田`). Leaves a name untouched if it does not end in an admin suffix.
66
65
  *
67
- * Hokkaido (`北海道`) is the deliberate exception: its name ends in 道 but is indivisible, so it is
68
- * returned whole rather than clipped to `北海` — mirroring the same carve-out in `prefecture.ts`.
66
+ * Hokkaido (`北海道`) is the deliberate exception: its name ends in 道 but is indivisible, so it is returned whole rather
67
+ * than clipped to `北海` — mirroring the same carve-out in `prefecture.ts`.
69
68
  */
70
69
  export function stripAdminSuffix(name) {
71
70
  if (typeof name !== "string" || name.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"address-unit.js","sourceRoot":"","sources":["../../jp/address-unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAA;AAKvF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAU,CAAA;AAK/D,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAExE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAW;IAChD,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC5C,IAAI,O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A;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAE,CAAA;IAEnC,OAAO,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC7D,CAAC"}
@@ -23,9 +23,9 @@
23
23
  */
24
24
  import type { Tagged } from "type-fest";
25
25
  /**
26
- * A Japanese postal code: three digits, a hyphen, then four digits (`100-0001`), conventionally
27
- * written after the 〒 mark (`〒100-0001`). Branded so a normalized code is distinct from an
28
- * arbitrary string — the 7-digit shape alone does not prove a code is real, only well-formed.
26
+ * A Japanese postal code: three digits, a hyphen, then four digits (`100-0001`), conventionally written after the 〒
27
+ * mark (`〒100-0001`). Branded so a normalized code is distinct from an arbitrary string — the 7-digit shape alone does
28
+ * not prove a code is real, only well-formed.
29
29
  *
30
30
  * @category Postal
31
31
  * @type string
@@ -36,28 +36,25 @@ export type PostalCode = Tagged<string, "JpPostalCode">;
36
36
  /** The postal-code shape: `NNN-NNNN`, the hyphen optional on input (`1000001` or `100-0001`). */
37
37
  export declare const JP_POSTAL_CODE_PATTERN: RegExp;
38
38
  /**
39
- * Normalize a postal-code surface form to the canonical hyphenated `NNN-NNNN`: strip a leading 〒
40
- * mark and any whitespace, then re-insert the hyphen if the input gave the bare seven digits
41
- * (`〒100-0001` → `100-0001`, `1000001` → `100-0001`). Returns null if the result is not seven
42
- * digits.
39
+ * Normalize a postal-code surface form to the canonical hyphenated `NNN-NNNN`: strip a leading 〒 mark and any
40
+ * whitespace, then re-insert the hyphen if the input gave the bare seven digits (`〒100-0001` → `100-0001`, `1000001` →
41
+ * `100-0001`). Returns null if the result is not seven digits.
43
42
  */
44
43
  export declare function normalizeJpPostalCode(raw: unknown): PostalCode | null;
45
44
  /** Type-predicate for a Japanese postal code (hyphen optional, `100-0001` or `1000001`). */
46
45
  export declare function isJpPostalCode(input: unknown): input is PostalCode;
47
46
  /**
48
- * First digit of the postal code → a coarse region label. Japan Post's numbering grows roughly
49
- * outward from Tokyo (`1xx`) and is **approximate** at this granularity — a single leading digit
50
- * spans large, irregular areas and the boundaries are postal-routing, not administrative. Use it as
51
- * a weak prior, never as a hard region assignment; the full code is what actually anchors the
52
- * address.
47
+ * First digit of the postal code → a coarse region label. Japan Post's numbering grows roughly outward from Tokyo
48
+ * (`1xx`) and is **approximate** at this granularity — a single leading digit spans large, irregular areas and the
49
+ * boundaries are postal-routing, not administrative. Use it as a weak prior, never as a hard region assignment; the
50
+ * full code is what actually anchors the address.
53
51
  *
54
52
  * Approximate — the labels below are illustrative routing regions, not precise prefecture sets.
55
53
  */
56
54
  export declare const JP_FIRST_DIGIT_REGION: Record<string, string>;
57
55
  /**
58
- * The coarse region label for a postal code's first digit, or null if the input is not a Japanese
59
- * postal code. A weak, approximate prior (see {@link JP_FIRST_DIGIT_REGION}); the full code anchors
60
- * the address.
56
+ * The coarse region label for a postal code's first digit, or null if the input is not a Japanese postal code. A weak,
57
+ * approximate prior (see {@link JP_FIRST_DIGIT_REGION}); the full code anchors the address.
61
58
  */
62
59
  export declare function firstDigitRegion(postalCode: unknown): string | null;
63
60
  //# sourceMappingURL=postal-code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postal-code.d.ts","sourceRoot":"","sources":["../../jp/postal-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAEvD,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,QAAmB,CAAA;AAEtD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAMrE;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAElE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWxD,CAAA;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAInE"}
1
+ {"version":3,"file":"postal-code.d.ts","sourceRoot":"","sources":["../../jp/postal-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAEvD,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,QAAmB,CAAA;AAEtD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAQrE;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAElE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWxD,CAAA;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAMnE"}
@@ -24,10 +24,9 @@
24
24
  /** The postal-code shape: `NNN-NNNN`, the hyphen optional on input (`1000001` or `100-0001`). */
25
25
  export const JP_POSTAL_CODE_PATTERN = /^\d{3}-?\d{4}$/;
26
26
  /**
27
- * Normalize a postal-code surface form to the canonical hyphenated `NNN-NNNN`: strip a leading 〒
28
- * mark and any whitespace, then re-insert the hyphen if the input gave the bare seven digits
29
- * (`〒100-0001` → `100-0001`, `1000001` → `100-0001`). Returns null if the result is not seven
30
- * digits.
27
+ * Normalize a postal-code surface form to the canonical hyphenated `NNN-NNNN`: strip a leading 〒 mark and any
28
+ * whitespace, then re-insert the hyphen if the input gave the bare seven digits (`〒100-0001` → `100-0001`, `1000001` →
29
+ * `100-0001`). Returns null if the result is not seven digits.
31
30
  */
32
31
  export function normalizeJpPostalCode(raw) {
33
32
  if (typeof raw !== "string")
@@ -43,11 +42,10 @@ export function isJpPostalCode(input) {
43
42
  return typeof input === "string" && JP_POSTAL_CODE_PATTERN.test(input);
44
43
  }
45
44
  /**
46
- * First digit of the postal code → a coarse region label. Japan Post's numbering grows roughly
47
- * outward from Tokyo (`1xx`) and is **approximate** at this granularity — a single leading digit
48
- * spans large, irregular areas and the boundaries are postal-routing, not administrative. Use it as
49
- * a weak prior, never as a hard region assignment; the full code is what actually anchors the
50
- * address.
45
+ * First digit of the postal code → a coarse region label. Japan Post's numbering grows roughly outward from Tokyo
46
+ * (`1xx`) and is **approximate** at this granularity — a single leading digit spans large, irregular areas and the
47
+ * boundaries are postal-routing, not administrative. Use it as a weak prior, never as a hard region assignment; the
48
+ * full code is what actually anchors the address.
51
49
  *
52
50
  * Approximate — the labels below are illustrative routing regions, not precise prefecture sets.
53
51
  */
@@ -64,9 +62,8 @@ export const JP_FIRST_DIGIT_REGION = {
64
62
  "9": "Tōhoku north / other",
65
63
  };
66
64
  /**
67
- * The coarse region label for a postal code's first digit, or null if the input is not a Japanese
68
- * postal code. A weak, approximate prior (see {@link JP_FIRST_DIGIT_REGION}); the full code anchors
69
- * the address.
65
+ * The coarse region label for a postal code's first digit, or null if the input is not a Japanese postal code. A weak,
66
+ * approximate prior (see {@link JP_FIRST_DIGIT_REGION}); the full code anchors the address.
70
67
  */
71
68
  export function firstDigitRegion(postalCode) {
72
69
  const normalized = normalizeJpPostalCode(postalCode);
@@ -1 +1 @@
1
- {"version":3,"file":"postal-code.js","sourceRoot":"","sources":["../../jp/postal-code.ts"],"names":[],"mappings":"AAAA;;;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IACb,GAAG,EAAE,sBAAsB;CAC3B,CAAA;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAmB;IACnD,MAAM,UAAU,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAA;IAEpD,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAA;IAE5B,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAE,CAAC,IAAI,IAAI,CAAA;AACrD,CAAC"}
@@ -36,8 +36,8 @@ export interface JapanesePrefectureInfo {
36
36
  type: JapanesePrefectureType;
37
37
  }
38
38
  /**
39
- * ISO 3166-2:JP numeric code → info, for all 47 prefectures. Ordered by code, which is also the
40
- * conventional north-to-south-ish ordering (Hokkaido `01` at the top, Okinawa `47` at the bottom).
39
+ * ISO 3166-2:JP numeric code → info, for all 47 prefectures. Ordered by code, which is also the conventional
40
+ * north-to-south-ish ordering (Hokkaido `01` at the top, Okinawa `47` at the bottom).
41
41
  */
42
42
  export declare const JP_PREFECTURES: {
43
43
  readonly "01": {
@@ -328,17 +328,17 @@ export type JapanesePrefectureCode = keyof typeof JP_PREFECTURES;
328
328
  /** Type-predicate for an ISO 3166-2:JP prefecture code (`"01"`..`"47"`). */
329
329
  export declare function isJapanesePrefectureCode(input: unknown): input is JapanesePrefectureCode;
330
330
  /**
331
- * Folded romaji / kanji surface form → ISO 3166-2:JP code. Every prefecture contributes several
332
- * keys: the macron-folded romaji (and the suffixed `name-ken` form folds to the same key), the full
333
- * kanji (`東京都`), and the suffix-less kanji (`東京`). Hokkaido keeps its 道 in both kanji keys.
331
+ * Folded romaji / kanji surface form → ISO 3166-2:JP code. Every prefecture contributes several keys: the macron-folded
332
+ * romaji (and the suffixed `name-ken` form folds to the same key), the full kanji (`東京都`), and the suffix-less kanji
333
+ * (`東京`). Hokkaido keeps its 道 in both kanji keys.
334
334
  */
335
335
  export declare const JP_PREFECTURE_NAME_TO_CODE: ReadonlyMap<string, JapanesePrefectureCode>;
336
336
  /**
337
337
  * Resolve a Japanese prefecture surface form to its ISO 3166-2:JP code, accepting:
338
338
  *
339
339
  * - A code directly (`"13"` → `"13"`),
340
- * - A romaji name, case-insensitive, macrons optional, with OR without the romaji type-suffix
341
- * (`Tōkyō` / `Tokyo` / `tokyo` / `Tokyo-to` → `"13"`),
340
+ * - A romaji name, case-insensitive, macrons optional, with OR without the romaji type-suffix (`Tōkyō` / `Tokyo` /
341
+ * `tokyo` / `Tokyo-to` → `"13"`),
342
342
  * - A kanji name, with or without its 都/道/府/県 suffix (`東京都` / `東京` → `"13"`).
343
343
  *
344
344
  * Returns null for anything it cannot place.
@@ -1 +1 @@
1
- {"version":3,"file":"prefecture.d.ts","sourceRoot":"","sources":["../../jp/prefecture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iEAAiE;AACjE,MAAM,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAA;AAE/D,8FAA8F;AAC9F,MAAM,WAAW,sBAAsB;IACtC,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAA;IACd,4DAA4D;IAC5D,IAAI,EAAE,sBAAsB,CAAA;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDgC,CAAA;AAE3D,yDA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MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,cAAc,CAAA;AAIhE,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,sBAAsB,CAExF;AAkCD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAW/E,CAAA;AAEJ;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,sBAAsB,GAAG,IAAI,CAQxG"}
@@ -23,8 +23,8 @@
23
23
  * `postal-code.ts` for why the postcode is nonetheless the single most reliable anchor.
24
24
  */
25
25
  /**
26
- * ISO 3166-2:JP numeric code → info, for all 47 prefectures. Ordered by code, which is also the
27
- * conventional north-to-south-ish ordering (Hokkaido `01` at the top, Okinawa `47` at the bottom).
26
+ * ISO 3166-2:JP numeric code → info, for all 47 prefectures. Ordered by code, which is also the conventional
27
+ * north-to-south-ish ordering (Hokkaido `01` at the top, Okinawa `47` at the bottom).
28
28
  */
29
29
  export const JP_PREFECTURES = {
30
30
  "01": { code: "01", kanji: "北海道", romaji: "Hokkaido", type: "do" },
@@ -83,14 +83,13 @@ export function isJapanesePrefectureCode(input) {
83
83
  /**
84
84
  * Fold a romaji surface form so `Tōkyō`, `Tokyo`, and `Tokyo-to` all key alike: strip macrons (NFD
85
85
  *
86
- * - Drop the combining marks), lowercase, peel off an appended `-to`/`-do`/`-fu`/`-ken` type-suffix,
87
- * then drop everything but `a-z`. `Tōkyō-to` and `tokyo` both → `tokyo`.
86
+ * - Drop the combining marks), lowercase, peel off an appended `-to`/`-do`/`-fu`/`-ken` type-suffix, then drop everything
87
+ * but `a-z`. `Tōkyō-to` and `tokyo` both → `tokyo`.
88
88
  *
89
- * The suffix is only stripped when it is a genuine appendage — separated by a
90
- * hyphen/space/middle-dot (`Tokyo-to`, `Osaka fu`) or trailing the macron-bearing long-vowel form.
91
- * That guard is essential: four bare romaji names already END in a suffix syllable (Kyo**to**,
92
- * Gi**fu**, Hokkai**do**, Kumamo**to**), and a blind trailing-strip would maim them. We never strip
93
- * from an unseparated bare name, so `kyoto` stays `kyoto`.
89
+ * The suffix is only stripped when it is a genuine appendage — separated by a hyphen/space/middle-dot (`Tokyo-to`,
90
+ * `Osaka fu`) or trailing the macron-bearing long-vowel form. That guard is essential: four bare romaji names already
91
+ * END in a suffix syllable (Kyo**to**, Gi**fu**, Hokkai**do**, Kumamo**to**), and a blind trailing-strip would maim
92
+ * them. We never strip from an unseparated bare name, so `kyoto` stays `kyoto`.
94
93
  */
95
94
  function foldRomaji(s) {
96
95
  const lowered = s
@@ -102,8 +101,8 @@ function foldRomaji(s) {
102
101
  return desuffixed.replace(/[^a-z]/g, "");
103
102
  }
104
103
  /**
105
- * Strip the trailing 都/道/府/県 admin kanji from a prefecture name (`東京都` → `東京`). Hokkaido is the
106
- * exception: `北海道` ends in 道 but is a single indivisible name, so it is left whole.
104
+ * Strip the trailing 都/道/府/県 admin kanji from a prefecture name (`東京都` → `東京`). Hokkaido is the exception: `北海道` ends
105
+ * in 道 but is a single indivisible name, so it is left whole.
107
106
  */
108
107
  function stripKanjiSuffix(kanji) {
109
108
  if (kanji === "北海道")
@@ -111,9 +110,9 @@ function stripKanjiSuffix(kanji) {
111
110
  return kanji.replace(/[都道府県]$/, "");
112
111
  }
113
112
  /**
114
- * Folded romaji / kanji surface form → ISO 3166-2:JP code. Every prefecture contributes several
115
- * keys: the macron-folded romaji (and the suffixed `name-ken` form folds to the same key), the full
116
- * kanji (`東京都`), and the suffix-less kanji (`東京`). Hokkaido keeps its 道 in both kanji keys.
113
+ * Folded romaji / kanji surface form → ISO 3166-2:JP code. Every prefecture contributes several keys: the macron-folded
114
+ * romaji (and the suffixed `name-ken` form folds to the same key), the full kanji (`東京都`), and the suffix-less kanji
115
+ * (`東京`). Hokkaido keeps its 道 in both kanji keys.
117
116
  */
118
117
  export const JP_PREFECTURE_NAME_TO_CODE = (() => {
119
118
  const out = new Map();
@@ -129,8 +128,8 @@ export const JP_PREFECTURE_NAME_TO_CODE = (() => {
129
128
  * Resolve a Japanese prefecture surface form to its ISO 3166-2:JP code, accepting:
130
129
  *
131
130
  * - A code directly (`"13"` → `"13"`),
132
- * - A romaji name, case-insensitive, macrons optional, with OR without the romaji type-suffix
133
- * (`Tōkyō` / `Tokyo` / `tokyo` / `Tokyo-to` → `"13"`),
131
+ * - A romaji name, case-insensitive, macrons optional, with OR without the romaji type-suffix (`Tōkyō` / `Tokyo` /
132
+ * `tokyo` / `Tokyo-to` → `"13"`),
134
133
  * - A kanji name, with or without its 都/道/府/県 suffix (`東京都` / `東京` → `"13"`).
135
134
  *
136
135
  * Returns null for anything it cannot place.