@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
@@ -20,14 +20,14 @@
20
20
  import type { SystemCode } from "./postcode-systems.js";
21
21
  export interface AddressSystemConventions {
22
22
  /**
23
- * Component tags that are NOT grammatical in this address system (names from the core
24
- * `ComponentTag` union; codex stays dependency-free so they are plain strings here).
23
+ * Component tags that are NOT grammatical in this address system (names from the core `ComponentTag` union; codex
24
+ * stays dependency-free so they are plain strings here).
25
25
  */
26
26
  readonly forbiddenTags?: readonly string[];
27
27
  /**
28
- * The system's canonical postcode shape. A decoded postcode span that is a strict sub-match of a
29
- * pattern-valid string in the raw text is shape-INVALID for this system and eligible for the
30
- * snap-only repair (extend/clip to the valid match — never invent a span).
28
+ * The system's canonical postcode shape. A decoded postcode span that is a strict sub-match of a pattern-valid string
29
+ * in the raw text is shape-INVALID for this system and eligible for the snap-only repair (extend/clip to the valid
30
+ * match — never invent a span).
31
31
  */
32
32
  readonly postcodePattern?: RegExp;
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"address-system-conventions.d.ts","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CA0B5F,CAAA;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,wBAAwB,GAAG,IAAI,CAG3G"}
1
+ {"version":3,"file":"address-system-conventions.d.ts","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAuB5F,CAAA;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,wBAAwB,GAAG,IAAI,CAI3G"}
@@ -20,25 +20,22 @@
20
20
  import { CODE_POSTAL_PATTERN } from "./fr/code-postal.js";
21
21
  export const ADDRESS_SYSTEM_CONVENTIONS = {
22
22
  /**
23
- * France (La Poste / AFNOR NF Z 10-011): the street TYPE is a LEADING particle of the street name
24
- * ("Rue de Rivoli", "Avenue des Champs-Élysées", "Cours Lafayette") and is labeled
25
- * `street_prefix` — French addresses DO carry a street_prefix, just never a trailing USPS-style
26
- * street_suffix (the libpostal French dictionaries have no trailing street-suffix class; Pub-28's
27
- * suffix decomposition has no French counterpart).
23
+ * France (La Poste / AFNOR NF Z 10-011): the street TYPE is a LEADING particle of the street name ("Rue de Rivoli",
24
+ * "Avenue des Champs-Élysées", "Cours Lafayette") and is labeled `street_prefix` — French addresses DO carry a
25
+ * street_prefix, just never a trailing USPS-style street_suffix (the libpostal French dictionaries have no trailing
26
+ * street-suffix class; Pub-28's suffix decomposition has no French counterpart).
28
27
  *
29
- * Provenance / why this is NOT a blanket prefix+suffix forbid (#719, 2026-06-18): an earlier
30
- * model mis-tagged the leading "Rue" as a US-style `street_suffix` (RUE is a Pub-28 suffix
31
- * variant) the 2026-06-10 v1.1.0 gate so #511 forbade BOTH affix tags to stop that leakage.
32
- * That forbid was correct for THAT model but became a live production bug for the current one:
33
- * the shipped model (v1.5.0) emits the FR `street_prefix` correctly, but the conventions mask was
34
- * a hard −1e9 on every B-/I-street_prefix emission, so the detected-FR parse could never KEEP a
35
- * prefix it destroyed `street_prefix` wholesale (measured on data/eval/external/
36
- * fr-street-prefix-real.jsonl at conventions=auto: F1 0.0 with the forbid on 80.0 with it off;
37
- * the larger real-FR eval reported the same collapse, ~96 ~0.6). We keep ONLY `street_suffix`
38
- * forbidden: the current model with the forbid OFF shows zero FR street_suffix leakage (fp=0 on
39
- * that same slice) and FR has no trailing street suffix, so the constraint costs nothing while
40
- * still guarding against any future suffix mis-tag. Postcode: exactly five digits (NF Z 10-011;
41
- * see fr/code-postal).
28
+ * Provenance / why this is NOT a blanket prefix+suffix forbid (#719, 2026-06-18): an earlier model mis-tagged the
29
+ * leading "Rue" as a US-style `street_suffix` (RUE is a Pub-28 suffix variant) — the 2026-06-10 v1.1.0 gate — so #511
30
+ * forbade BOTH affix tags to stop that leakage. That forbid was correct for THAT model but became a live production
31
+ * bug for the current one: the shipped model (v1.5.0) emits the FR `street_prefix` correctly, but the conventions
32
+ * mask was a hard −1e9 on every B-/I-street_prefix emission, so the detected-FR parse could never KEEP a prefix — it
33
+ * destroyed `street_prefix` wholesale (measured on data/eval/external/ fr-street-prefix-real.jsonl at
34
+ * conventions=auto: F1 0.0 with the forbid on → 80.0 with it off; the larger real-FR eval reported the same collapse,
35
+ * ~96 → ~0.6). We keep ONLY `street_suffix` forbidden: the current model with the forbid OFF shows zero FR
36
+ * street_suffix leakage (fp=0 on that same slice) and FR has no trailing street suffix, so the constraint costs
37
+ * nothing while still guarding against any future suffix mis-tag. Postcode: exactly five digits (NF Z 10-011; see
38
+ * fr/code-postal).
42
39
  */
43
40
  fr: {
44
41
  forbiddenTags: ["street_suffix"],
@@ -1 +1 @@
1
- {"version":3,"file":"address-system-conventions.js","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAiBzD,MAAM,CAAC,MAAM,0BAA0B,GAA0D;IAChG;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,EAAE,EAAE;QACH,aAAa,EAAE,CAAC,eAAe,CAAC;QAChC,eAAe,EAAE,mBAAmB;KACpC;CACD,CAAA;AAED,iGAAiG;AACjG,MAAM,UAAU,oBAAoB,CAAC,MAAqC;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IACxB,OAAO,0BAA0B,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;AAClD,CAAC"}
1
+ {"version":3,"file":"address-system-conventions.js","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAiBzD,MAAM,CAAC,MAAM,0BAA0B,GAA0D;IAChG;;;;;;;;;;;;;;;;;OAiBG;IACH,EAAE,EAAE;QACH,aAAa,EAAE,CAAC,eAAe,CAAC;QAChC,eAAe,EAAE,mBAAmB;KACpC;CACD,CAAA;AAED,iGAAiG;AACjG,MAAM,UAAU,oBAAoB,CAAC,MAAqC;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAExB,OAAO,0BAA0B,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;AAClD,CAAC"}
@@ -46,23 +46,21 @@ export interface AuDeliveryServiceDesignator {
46
46
  /** The standard abbreviation — the surface form written on mail ("GPO BOX", "LOCKED BAG"). */
47
47
  abbreviation: string;
48
48
  /**
49
- * Whether the designator "must have an associated number for a match to occur" (AMAS rule;
50
- * exceptions are Care of Post Office, Community Mail Agent, Community Postal Agent, and Community
51
- * Mail Bag).
49
+ * Whether the designator "must have an associated number for a match to occur" (AMAS rule; exceptions are Care of
50
+ * Post Office, Community Mail Agent, Community Postal Agent, and Community Mail Bag).
52
51
  */
53
52
  requiresNumber: boolean;
54
53
  /**
55
- * True when the designator is recognized by the AMAS Postal Delivery Type table but absent from
56
- * every current auspost.com.au addressing/product page (accessed 2026-06-11) — the rural and
57
- * community forms superseded by rural street addressing under AS/NZS 4819. The parser must still
58
- * RECOGNIZE these on old addresses; synthesis should weight them low.
54
+ * True when the designator is recognized by the AMAS Postal Delivery Type table but absent from every current
55
+ * auspost.com.au addressing/product page (accessed 2026-06-11) — the rural and community forms superseded by rural
56
+ * street addressing under AS/NZS 4819. The parser must still RECOGNIZE these on old addresses; synthesis should
57
+ * weight them low.
59
58
  */
60
59
  legacy: boolean;
61
60
  }
62
61
  /**
63
- * The verbatim Postal Delivery Type table (see the module header for the per-row provenance).
64
- * Multiple names can share an abbreviation (ROADSIDE MAIL BAG and ROADSIDE MAIL BOX are both RMB;
65
- * POSTE RESTANTE is addressed as CARE PO).
62
+ * The verbatim Postal Delivery Type table (see the module header for the per-row provenance). Multiple names can share
63
+ * an abbreviation (ROADSIDE MAIL BAG and ROADSIDE MAIL BOX are both RMB; POSTE RESTANTE is addressed as CARE PO).
66
64
  */
67
65
  export declare const AU_DELIVERY_SERVICE_DESIGNATORS: readonly [{
68
66
  readonly name: "GENERAL POST OFFICE BOX";
@@ -149,17 +147,16 @@ export interface AuDeliveryServiceMatch {
149
147
  legacy: boolean;
150
148
  }
151
149
  /**
152
- * If `input` is a standalone Australia Post delivery-service phrase ("GPO Box 2890", "Locked Bag
153
- * 1797", "RMB 4600", bare "CMB"), return the canonical designator, the id, and the legacy flag.
154
- * Null otherwise — including for "Private Box", which Australia Post explicitly calls out as not a
155
- * valid type.
150
+ * If `input` is a standalone Australia Post delivery-service phrase ("GPO Box 2890", "Locked Bag 1797", "RMB 4600",
151
+ * bare "CMB"), return the canonical designator, the id, and the legacy flag. Null otherwise — including for "Private
152
+ * Box", which Australia Post explicitly calls out as not a valid type.
156
153
  */
157
154
  export declare function matchAuDeliveryService(input: unknown): AuDeliveryServiceMatch | null;
158
155
  /** Type-predicate: does the input look like a standalone AU delivery-service address line? */
159
156
  export declare function isAuDeliveryService(input: unknown): boolean;
160
157
  /**
161
- * Normalize a recognized delivery-service phrase to the canonical AMAS form (`"g.p.o. box 123"` →
162
- * `"GPO BOX 123"`). Returns the input unchanged if it isn't one.
158
+ * Normalize a recognized delivery-service phrase to the canonical AMAS form (`"g.p.o. box 123"` → `"GPO BOX 123"`).
159
+ * Returns the input unchanged if it isn't one.
163
160
  */
164
161
  export declare function normalizeAuDeliveryService(input: string): string;
165
162
  //# sourceMappingURL=delivery-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delivery-service.d.ts","sourceRoot":"","sources":["../../au/delivery-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,oFAAoF;AACpF,MAAM,WAAW,2BAA2B;IAC3C,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAA;IACZ,8FAA8F;IAC9F,YAAY,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAA;IACvB;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAA;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAee,C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,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACtC,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAA;IACf,iFAAiF;IACjF,UAAU,EAAE,6BAA6B,CAAA;IACzC,iEAAiE;IACjE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAA;CACf;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,GAAG,IAAI,CAkBpF;AAED,8FAA8F;AAC9F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhE"}
@@ -40,9 +40,8 @@
40
40
  * @see {@link https://auspost.com.au/business/business-admin/po-boxes-and-locked-bags Australia Post — business PO Boxes, GPO Boxes and Locked Bags}
41
41
  */
42
42
  /**
43
- * The verbatim Postal Delivery Type table (see the module header for the per-row provenance).
44
- * Multiple names can share an abbreviation (ROADSIDE MAIL BAG and ROADSIDE MAIL BOX are both RMB;
45
- * POSTE RESTANTE is addressed as CARE PO).
43
+ * The verbatim Postal Delivery Type table (see the module header for the per-row provenance). Multiple names can share
44
+ * an abbreviation (ROADSIDE MAIL BAG and ROADSIDE MAIL BOX are both RMB; POSTE RESTANTE is addressed as CARE PO).
46
45
  */
47
46
  export const AU_DELIVERY_SERVICE_DESIGNATORS = [
48
47
  { name: "GENERAL POST OFFICE BOX", abbreviation: "GPO BOX", requiresNumber: true, legacy: false },
@@ -61,13 +60,13 @@ export const AU_DELIVERY_SERVICE_DESIGNATORS = [
61
60
  { name: "ROADSIDE MAIL SERVICE", abbreviation: "RMS", requiresNumber: true, legacy: true },
62
61
  ];
63
62
  /**
64
- * Per-designator surface patterns (designator phrase only, no anchor, no id). Ordered longest /
65
- * most-specific first so the matcher prefers "GPO Box" over "PO Box" and "RMS" over "MS". Each
66
- * pattern tolerates the punctuation AMAS tells mailers to strip ("the full stops and commas in
67
- * R.M.B and P.O.") — recognition must accept what deliverable mail actually carries.
63
+ * Per-designator surface patterns (designator phrase only, no anchor, no id). Ordered longest / most-specific first so
64
+ * the matcher prefers "GPO Box" over "PO Box" and "RMS" over "MS". Each pattern tolerates the punctuation AMAS tells
65
+ * mailers to strip ("the full stops and commas in R.M.B and P.O.") — recognition must accept what deliverable mail
66
+ * actually carries.
68
67
  *
69
- * MS is special-cased in {@link matchAuDeliveryService}: its identifier must start with a digit so
70
- * the bare two-letter designator cannot swallow an honorific ("Ms Smith").
68
+ * MS is special-cased in {@link matchAuDeliveryService}: its identifier must start with a digit so the bare two-letter
69
+ * designator cannot swallow an honorific ("Ms Smith").
71
70
  */
72
71
  const DESIGNATOR_PATTERNS = [
73
72
  ["GPO BOX", String.raw `general\s+post\s+office\s+box|g\.?\s*p\.?\s*o\.?\s*box`],
@@ -93,10 +92,9 @@ const MATCHERS = DESIGNATOR_PATTERNS.map(([abbreviation, src]) => {
93
92
  return { abbreviation, re: new RegExp(String.raw `^\s*(${src})${tail}\s*$`, "i") };
94
93
  });
95
94
  /**
96
- * If `input` is a standalone Australia Post delivery-service phrase ("GPO Box 2890", "Locked Bag
97
- * 1797", "RMB 4600", bare "CMB"), return the canonical designator, the id, and the legacy flag.
98
- * Null otherwise — including for "Private Box", which Australia Post explicitly calls out as not a
99
- * valid type.
95
+ * If `input` is a standalone Australia Post delivery-service phrase ("GPO Box 2890", "Locked Bag 1797", "RMB 4600",
96
+ * bare "CMB"), return the canonical designator, the id, and the legacy flag. Null otherwise — including for "Private
97
+ * Box", which Australia Post explicitly calls out as not a valid type.
100
98
  */
101
99
  export function matchAuDeliveryService(input) {
102
100
  if (typeof input !== "string")
@@ -120,8 +118,8 @@ export function isAuDeliveryService(input) {
120
118
  return matchAuDeliveryService(input) !== null;
121
119
  }
122
120
  /**
123
- * Normalize a recognized delivery-service phrase to the canonical AMAS form (`"g.p.o. box 123"` →
124
- * `"GPO BOX 123"`). Returns the input unchanged if it isn't one.
121
+ * Normalize a recognized delivery-service phrase to the canonical AMAS form (`"g.p.o. box 123"` → `"GPO BOX 123"`).
122
+ * Returns the input unchanged if it isn't one.
125
123
  */
126
124
  export function normalizeAuDeliveryService(input) {
127
125
  const m = matchAuDeliveryService(input);
@@ -1 +1 @@
1
- {"version":3,"file":"delivery-service.js","sourceRoot":"","sources":["../../au/delivery-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAuBH;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC9C,EAAE,IAAI,EAAE,yBAAyB,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;IACjG,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;IACxF,EAAE,IAAI,EAAE,yBAAyB,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;IACpG,EAAE,IAAI,EAAE,0BAA0B,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;IACtG,EAAE,IAAI,EAAE,oBAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;IACxF,EAAE,IAAI,EAAE,sBAAsB,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;IAC1F,EAAE,IAAI,EAAE,wBAAwB,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;IAC5F,EAAE,IAAI,EAAE,qBAAqB,EAAE,YAAY,EAAE,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ChB,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,YAAY,CAAE,CAAA;QAE/C,OAAO;YACN,OAAO,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE;YACrB,UAAU,EAAE,YAAY;YACxB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CAAA;IACF,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,mBAAmB,CAAC,KAAc;IACjD,OAAO,sBAAsB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa;IACvD,MAAM,CAAC,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;IAEvC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAEpB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA;AACrE,CAAC"}
@@ -39,9 +39,9 @@
39
39
  /**
40
40
  * One AMAS / AS 4590.1 level-type row.
41
41
  *
42
- * The `type` is the AS 4590.1 LEVEL_TYPE_CODE value (what GNAF and AMAS use internally); the
43
- * `abbreviation` is the approved surface form used in formatted mail; the `requiresNumber` flag
44
- * distinguishes designators that take a floor identifier from standalone ones.
42
+ * The `type` is the AS 4590.1 LEVEL_TYPE_CODE value (what GNAF and AMAS use internally); the `abbreviation` is the
43
+ * approved surface form used in formatted mail; the `requiresNumber` flag distinguishes designators that take a floor
44
+ * identifier from standalone ones.
45
45
  */
46
46
  export interface AuLevelDesignator {
47
47
  /** AS 4590.1 LEVEL_TYPE_CODE (the GNAF / AMAS internal code). */
@@ -51,15 +51,14 @@ export interface AuLevelDesignator {
51
51
  /** The approved AMAS surface abbreviation written on mail ("L", "B", "M"). */
52
52
  abbreviation: string;
53
53
  /**
54
- * True when the designator takes a numeric or alphanumeric floor identifier after it (`LEVEL 3`,
55
- * `BASEMENT 2`). False for standalone types (`GROUND`, `MEZZANINE`, `ROOFTOP`) that name a
56
- * specific well-known floor by vocabulary alone.
54
+ * True when the designator takes a numeric or alphanumeric floor identifier after it (`LEVEL 3`, `BASEMENT 2`). False
55
+ * for standalone types (`GROUND`, `MEZZANINE`, `ROOFTOP`) that name a specific well-known floor by vocabulary alone.
57
56
  */
58
57
  requiresNumber: boolean;
59
58
  }
60
59
  /**
61
- * AMAS / AS 4590.1-2017 level-type table (Table 3). Verbatim codes; see the module header for
62
- * provenance. Ordered with the most-common forms first for match priority.
60
+ * AMAS / AS 4590.1-2017 level-type table (Table 3). Verbatim codes; see the module header for provenance. Ordered with
61
+ * the most-common forms first for match priority.
63
62
  */
64
63
  export declare const AU_LEVEL_DESIGNATORS: readonly [{
65
64
  readonly code: "L";
@@ -110,16 +109,16 @@ export declare const AU_LEVEL_DESIGNATORS: readonly [{
110
109
  /** A canonical AS 4590.1 LEVEL_TYPE_CODE. */
111
110
  export type AuLevelCode = (typeof AU_LEVEL_DESIGNATORS)[number]["code"];
112
111
  /**
113
- * Recognized surface variants for each AMAS level code — the canonical code/abbreviation pair PLUS
114
- * additional forms found in real AU addresses (Open Addresses export) that the parser must
115
- * RECOGNIZE but the synthesis layer should not favor over the canonical form.
112
+ * Recognized surface variants for each AMAS level code — the canonical code/abbreviation pair PLUS additional forms
113
+ * found in real AU addresses (Open Addresses export) that the parser must RECOGNIZE but the synthesis layer should not
114
+ * favor over the canonical form.
116
115
  *
117
116
  * Synthesis uses only the first element (the AMAS canonical surface). Recognition accepts all.
118
117
  */
119
118
  export declare const AU_LEVEL_DESIGNATOR_VARIANTS: Readonly<Record<AuLevelCode, readonly string[]>>;
120
119
  /**
121
- * Inverse lookup: every variant (abbreviation or surface form) → the canonical AMAS code.
122
- * Lowercase-keyed for case-insensitive matching (`"level"` → `"L"`, `"bsmt"` → `"B"`).
120
+ * Inverse lookup: every variant (abbreviation or surface form) → the canonical AMAS code. Lowercase-keyed for
121
+ * case-insensitive matching (`"level"` → `"L"`, `"bsmt"` → `"B"`).
123
122
  */
124
123
  export declare const AU_LEVEL_DESIGNATOR_LOOKUP: ReadonlyMap<string, AuLevelCode>;
125
124
  /** Result of an AU level designator parse. */
@@ -132,19 +131,19 @@ export interface AuLevelDesignatorMatch {
132
131
  identifier?: string;
133
132
  }
134
133
  /**
135
- * If `input` is a standalone AU level designator phrase ("Level 3", "L 12", "Ground Floor",
136
- * "Mezzanine", "B 2"), return the canonical code and identifier. Null otherwise. Malformed entries
137
- * (a requires-number designator with no identifier, e.g. bare "Level") return null — the builder
138
- * throws loudly when a row in a table violates this constraint.
134
+ * If `input` is a standalone AU level designator phrase ("Level 3", "L 12", "Ground Floor", "Mezzanine", "B 2"), return
135
+ * the canonical code and identifier. Null otherwise. Malformed entries (a requires-number designator with no
136
+ * identifier, e.g. bare "Level") return null — the builder throws loudly when a row in a table violates this
137
+ * constraint.
139
138
  */
140
139
  export declare function matchAuLevelDesignator(input: unknown): AuLevelDesignatorMatch | null;
141
140
  /** Type-predicate: does the input look like a standalone AU level designator phrase? */
142
141
  export declare function isAuLevelDesignator(input: unknown): boolean;
143
142
  /**
144
- * Normalize a recognized level phrase to the AMAS canonical form (`"level 3"` → `"L 3"`, `"ground
145
- * floor"` → `"G"`). Returns the input unchanged if it isn't a level designator phrase. Throws if a
146
- * row in {@link AU_LEVEL_DESIGNATORS} is malformed (requires-number entry with no abbreviation or
147
- * empty name) — the builder must surface structural defects loudly.
143
+ * Normalize a recognized level phrase to the AMAS canonical form (`"level 3"` → `"L 3"`, `"ground floor"` → `"G"`).
144
+ * Returns the input unchanged if it isn't a level designator phrase. Throws if a row in {@link AU_LEVEL_DESIGNATORS} is
145
+ * malformed (requires-number entry with no abbreviation or empty name) — the builder must surface structural defects
146
+ * loudly.
148
147
  */
149
148
  export declare function normalizeAuLevelDesignator(input: string): string;
150
149
  //# sourceMappingURL=level-designator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"level-designator.d.ts","sourceRoot":"","sources":["../../au/level-designator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUgB,CAAA;AAEjD,6CAA6C;AAC7C,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC,CAUzF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAyBpE,CAAA;AAEJ,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACtC,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAA;IACf,+DAA+D;IAC/D,IAAI,EAAE,WAAW,CAAA;IACjB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAoBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,G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E,OAAO,GAAG,sBAAsB,GAAG,IAAI,CAgBpF;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhE"}
@@ -37,8 +37,8 @@
37
37
  * @see {@link https://www.iso.org/standard/67840.html AS 4590.1-2017 — Interchange of client information}
38
38
  */
39
39
  /**
40
- * AMAS / AS 4590.1-2017 level-type table (Table 3). Verbatim codes; see the module header for
41
- * provenance. Ordered with the most-common forms first for match priority.
40
+ * AMAS / AS 4590.1-2017 level-type table (Table 3). Verbatim codes; see the module header for provenance. Ordered with
41
+ * the most-common forms first for match priority.
42
42
  */
43
43
  export const AU_LEVEL_DESIGNATORS = [
44
44
  { code: "L", name: "LEVEL", abbreviation: "L", requiresNumber: true },
@@ -52,9 +52,9 @@ export const AU_LEVEL_DESIGNATORS = [
52
52
  { code: "RT", name: "ROOFTOP", abbreviation: "RT", requiresNumber: false },
53
53
  ];
54
54
  /**
55
- * Recognized surface variants for each AMAS level code — the canonical code/abbreviation pair PLUS
56
- * additional forms found in real AU addresses (Open Addresses export) that the parser must
57
- * RECOGNIZE but the synthesis layer should not favor over the canonical form.
55
+ * Recognized surface variants for each AMAS level code — the canonical code/abbreviation pair PLUS additional forms
56
+ * found in real AU addresses (Open Addresses export) that the parser must RECOGNIZE but the synthesis layer should not
57
+ * favor over the canonical form.
58
58
  *
59
59
  * Synthesis uses only the first element (the AMAS canonical surface). Recognition accepts all.
60
60
  */
@@ -70,8 +70,8 @@ export const AU_LEVEL_DESIGNATOR_VARIANTS = {
70
70
  RT: ["RT", "ROOFTOP", "ROOF"],
71
71
  };
72
72
  /**
73
- * Inverse lookup: every variant (abbreviation or surface form) → the canonical AMAS code.
74
- * Lowercase-keyed for case-insensitive matching (`"level"` → `"L"`, `"bsmt"` → `"B"`).
73
+ * Inverse lookup: every variant (abbreviation or surface form) → the canonical AMAS code. Lowercase-keyed for
74
+ * case-insensitive matching (`"level"` → `"L"`, `"bsmt"` → `"B"`).
75
75
  */
76
76
  export const AU_LEVEL_DESIGNATOR_LOOKUP = (() => {
77
77
  // Structural integrity check: every code must have at least one non-empty variant. Throw at
@@ -116,10 +116,10 @@ const LEVEL_MATCHERS = (() => {
116
116
  return rows;
117
117
  })();
118
118
  /**
119
- * If `input` is a standalone AU level designator phrase ("Level 3", "L 12", "Ground Floor",
120
- * "Mezzanine", "B 2"), return the canonical code and identifier. Null otherwise. Malformed entries
121
- * (a requires-number designator with no identifier, e.g. bare "Level") return null — the builder
122
- * throws loudly when a row in a table violates this constraint.
119
+ * If `input` is a standalone AU level designator phrase ("Level 3", "L 12", "Ground Floor", "Mezzanine", "B 2"), return
120
+ * the canonical code and identifier. Null otherwise. Malformed entries (a requires-number designator with no
121
+ * identifier, e.g. bare "Level") return null — the builder throws loudly when a row in a table violates this
122
+ * constraint.
123
123
  */
124
124
  export function matchAuLevelDesignator(input) {
125
125
  if (typeof input !== "string")
@@ -141,10 +141,10 @@ export function isAuLevelDesignator(input) {
141
141
  return matchAuLevelDesignator(input) !== null;
142
142
  }
143
143
  /**
144
- * Normalize a recognized level phrase to the AMAS canonical form (`"level 3"` → `"L 3"`, `"ground
145
- * floor"` → `"G"`). Returns the input unchanged if it isn't a level designator phrase. Throws if a
146
- * row in {@link AU_LEVEL_DESIGNATORS} is malformed (requires-number entry with no abbreviation or
147
- * empty name) — the builder must surface structural defects loudly.
144
+ * Normalize a recognized level phrase to the AMAS canonical form (`"level 3"` → `"L 3"`, `"ground floor"` → `"G"`).
145
+ * Returns the input unchanged if it isn't a level designator phrase. Throws if a row in {@link AU_LEVEL_DESIGNATORS} is
146
+ * malformed (requires-number entry with no abbreviation or empty name) — the builder must surface structural defects
147
+ * loudly.
148
148
  */
149
149
  export function normalizeAuLevelDesignator(input) {
150
150
  const m = matchAuLevelDesignator(input);
@@ -1 +1 @@
1
- {"version":3,"file":"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,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAE,CAAA;IAEhE,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,YAAY,IAAI,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAA;AAC7F,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"postcode.d.ts","sourceRoot":"","sources":["../../au/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAErD,kDAAkD;AAClD,eAAO,MAAM,mBAAmB,QAAY,CAAA;AAE5C,8FAA8F;AAC9F,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAInE;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
1
+ {"version":3,"file":"postcode.d.ts","sourceRoot":"","sources":["../../au/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAErD,kDAAkD;AAClD,eAAO,MAAM,mBAAmB,QAAY,CAAA;AAE5C,8FAA8F;AAC9F,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAKnE;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"postcode.js","sourceRoot":"","sources":["../../au/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAcH,kDAAkD;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAE5C,8FAA8F;AAC9F,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IACxC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IACpB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAgB,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9D,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACpE,CAAC"}
1
+ {"version":3,"file":"postcode.js","sourceRoot":"","sources":["../../au/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAcH,kDAAkD;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAE5C,8FAA8F;AAC9F,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IACxC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAEpB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAgB,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9D,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACpE,CAAC"}
@@ -27,9 +27,9 @@
27
27
  import type { Tagged } from "type-fest";
28
28
  import type { CanadianProvinceCode } from "./province.js";
29
29
  /**
30
- * A Canadian postal code: `A1A 1A1`. Six alphanumeric characters in a strict
31
- * Letter-Digit-Letter-Digit-Letter-Digit pattern, conventionally written with a single space after
32
- * the third. Unlike the other systems' bare five digits, the shape alone already says "Canada".
30
+ * A Canadian postal code: `A1A 1A1`. Six alphanumeric characters in a strict Letter-Digit-Letter-Digit-Letter-Digit
31
+ * pattern, conventionally written with a single space after the third. Unlike the other systems' bare five digits, the
32
+ * shape alone already says "Canada".
33
33
  *
34
34
  * @category Postal
35
35
  * @type string
@@ -38,37 +38,35 @@ import type { CanadianProvinceCode } from "./province.js";
38
38
  */
39
39
  export type PostalCode = Tagged<string, "CaPostalCode">;
40
40
  /**
41
- * The Canadian postal-code shape. The valid FIRST letters exclude `D F I O Q U W Z` (never used to
42
- * open a postcode); the interior letters additionally exclude `D F I O Q U` (the visually ambiguous
43
- * ones). The space between FSA and LDU is optional in the raw form.
41
+ * The Canadian postal-code shape. The valid FIRST letters exclude `D F I O Q U W Z` (never used to open a postcode);
42
+ * the interior letters additionally exclude `D F I O Q U` (the visually ambiguous ones). The space between FSA and LDU
43
+ * is optional in the raw form.
44
44
  */
45
45
  export declare const CA_POSTAL_CODE_PATTERN: RegExp;
46
46
  /**
47
- * Normalize a postal-code surface form to canonical `A1A 1A1`: uppercase and ensure exactly one
48
- * space between the FSA (first three chars) and the LDU (last three) — `K1A0B1` → `K1A 0B1`, `k1a
49
- * 0b1` → `K1A 0B1`. Returns null if the input is not a valid Canadian postal code.
47
+ * Normalize a postal-code surface form to canonical `A1A 1A1`: uppercase and ensure exactly one space between the FSA
48
+ * (first three chars) and the LDU (last three) — `K1A0B1` → `K1A 0B1`, `k1a 0b1` → `K1A 0B1`. Returns null if the input
49
+ * is not a valid Canadian postal code.
50
50
  */
51
51
  export declare function normalizeCaPostalCode(raw: unknown): PostalCode | null;
52
52
  /** Type-predicate for a Canadian postal code (accepts the spaced or unspaced surface form). */
53
53
  export declare function isCaPostalCode(input: unknown): input is PostalCode;
54
54
  /**
55
- * FSA first letter → province/territory. Clean (one province per letter) except `X`, shared by the
56
- * Northwest Territories and Nunavut, and the large provinces that span several letters: Ontario
57
- * owns `K L M N P` and Quebec owns `G H J`. Letters `D F I O Q U W Z` never open a Canadian
58
- * postcode and so do not appear here.
55
+ * FSA first letter → province/territory. Clean (one province per letter) except `X`, shared by the Northwest
56
+ * Territories and Nunavut, and the large provinces that span several letters: Ontario owns `K L M N P` and Quebec owns
57
+ * `G H J`. Letters `D F I O Q U W Z` never open a Canadian postcode and so do not appear here.
59
58
  */
60
59
  export declare const FSA_LETTER_TO_PROVINCE: Record<string, CanadianProvinceCode | CanadianProvinceCode[]>;
61
60
  /**
62
- * The province/territory a postal code belongs to, via its FSA first letter. Returns the single
63
- * code for the clean letters, the `["NT", "NU"]` pair for the shared `X`, and null if the input is
64
- * not a valid Canadian postal code (or its first letter has no province, which the pattern already
65
- * forbids).
61
+ * The province/territory a postal code belongs to, via its FSA first letter. Returns the single code for the clean
62
+ * letters, the `["NT", "NU"]` pair for the shared `X`, and null if the input is not a valid Canadian postal code (or
63
+ * its first letter has no province, which the pattern already forbids).
66
64
  */
67
65
  export declare function provinceOfPostalCode(postalCode: unknown): CanadianProvinceCode | CanadianProvinceCode[] | null;
68
66
  /**
69
- * True when a postal code is RURAL: its SECOND character (the FSA's first digit) is `0`. Canada
70
- * Post uses a `0` in that position to mark the lower-density delivery zones (rural routes, small
71
- * communities) — the contrast with the urban `1`–`9` FSAs. Returns false for a non-code.
67
+ * True when a postal code is RURAL: its SECOND character (the FSA's first digit) is `0`. Canada Post uses a `0` in that
68
+ * position to mark the lower-density delivery zones (rural routes, small communities) — the contrast with the urban
69
+ * `1`–`9` FSAs. Returns false for a non-code.
72
70
  */
73
71
  export declare function isRuralPostalCode(pc: unknown): boolean;
74
72
  //# sourceMappingURL=postal-code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postal-code.d.ts","sourceRoot":"","sources":["../../ca/postal-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEzD;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAsE,CAAA;AAEzG;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAMrE;AAED,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAElE;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,CAmBhG,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,OAAO,GAAG,oBAAoB,GAAG,oBAAoB,EAAE,GAAG,IAAI,CAI9G;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAItD"}
1
+ {"version":3,"file":"postal-code.d.ts","sourceRoot":"","sources":["../../ca/postal-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEzD;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAsE,CAAA;AAEzG;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAQrE;AAED,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAElE;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,CAmBhG,CAAA;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,OAAO,GAAG,oBAAoB,GAAG,oBAAoB,EAAE,GAAG,IAAI,CAM9G;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAMtD"}
@@ -25,15 +25,15 @@
25
25
  * the bridge to the wider, lower-density delivery zones.
26
26
  */
27
27
  /**
28
- * The Canadian postal-code shape. The valid FIRST letters exclude `D F I O Q U W Z` (never used to
29
- * open a postcode); the interior letters additionally exclude `D F I O Q U` (the visually ambiguous
30
- * ones). The space between FSA and LDU is optional in the raw form.
28
+ * The Canadian postal-code shape. The valid FIRST letters exclude `D F I O Q U W Z` (never used to open a postcode);
29
+ * the interior letters additionally exclude `D F I O Q U` (the visually ambiguous ones). The space between FSA and LDU
30
+ * is optional in the raw form.
31
31
  */
32
32
  export const CA_POSTAL_CODE_PATTERN = /^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z] ?\d[ABCEGHJ-NPRSTV-Z]\d$/i;
33
33
  /**
34
- * Normalize a postal-code surface form to canonical `A1A 1A1`: uppercase and ensure exactly one
35
- * space between the FSA (first three chars) and the LDU (last three) — `K1A0B1` → `K1A 0B1`, `k1a
36
- * 0b1` → `K1A 0B1`. Returns null if the input is not a valid Canadian postal code.
34
+ * Normalize a postal-code surface form to canonical `A1A 1A1`: uppercase and ensure exactly one space between the FSA
35
+ * (first three chars) and the LDU (last three) — `K1A0B1` → `K1A 0B1`, `k1a 0b1` → `K1A 0B1`. Returns null if the input
36
+ * is not a valid Canadian postal code.
37
37
  */
38
38
  export function normalizeCaPostalCode(raw) {
39
39
  if (typeof raw !== "string")
@@ -49,10 +49,9 @@ export function isCaPostalCode(input) {
49
49
  return typeof input === "string" && CA_POSTAL_CODE_PATTERN.test(input);
50
50
  }
51
51
  /**
52
- * FSA first letter → province/territory. Clean (one province per letter) except `X`, shared by the
53
- * Northwest Territories and Nunavut, and the large provinces that span several letters: Ontario
54
- * owns `K L M N P` and Quebec owns `G H J`. Letters `D F I O Q U W Z` never open a Canadian
55
- * postcode and so do not appear here.
52
+ * FSA first letter → province/territory. Clean (one province per letter) except `X`, shared by the Northwest
53
+ * Territories and Nunavut, and the large provinces that span several letters: Ontario owns `K L M N P` and Quebec owns
54
+ * `G H J`. Letters `D F I O Q U W Z` never open a Canadian postcode and so do not appear here.
56
55
  */
57
56
  export const FSA_LETTER_TO_PROVINCE = {
58
57
  A: "NL",
@@ -75,10 +74,9 @@ export const FSA_LETTER_TO_PROVINCE = {
75
74
  Y: "YT",
76
75
  };
77
76
  /**
78
- * The province/territory a postal code belongs to, via its FSA first letter. Returns the single
79
- * code for the clean letters, the `["NT", "NU"]` pair for the shared `X`, and null if the input is
80
- * not a valid Canadian postal code (or its first letter has no province, which the pattern already
81
- * forbids).
77
+ * The province/territory a postal code belongs to, via its FSA first letter. Returns the single code for the clean
78
+ * letters, the `["NT", "NU"]` pair for the shared `X`, and null if the input is not a valid Canadian postal code (or
79
+ * its first letter has no province, which the pattern already forbids).
82
80
  */
83
81
  export function provinceOfPostalCode(postalCode) {
84
82
  const normalized = normalizeCaPostalCode(postalCode);
@@ -87,9 +85,9 @@ export function provinceOfPostalCode(postalCode) {
87
85
  return FSA_LETTER_TO_PROVINCE[normalized[0]] ?? null;
88
86
  }
89
87
  /**
90
- * True when a postal code is RURAL: its SECOND character (the FSA's first digit) is `0`. Canada
91
- * Post uses a `0` in that position to mark the lower-density delivery zones (rural routes, small
92
- * communities) — the contrast with the urban `1`–`9` FSAs. Returns false for a non-code.
88
+ * True when a postal code is RURAL: its SECOND character (the FSA's first digit) is `0`. Canada Post uses a `0` in that
89
+ * position to mark the lower-density delivery zones (rural routes, small communities) — the contrast with the urban
90
+ * `1`–`9` FSAs. Returns false for a non-code.
93
91
  */
94
92
  export function isRuralPostalCode(pc) {
95
93
  const normalized = normalizeCaPostalCode(pc);
@@ -1 +1 @@
1
- {"version":3,"file":"postal-code.js","sourceRoot":"","sources":["../../ca/postal-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAiBH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,mEAAmE,CAAA;AAEzG;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAY;IACjD,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IACxC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAC5D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACrC,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IAC3D,OAAO,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,MAAqB,CAAC,CAAC,CAAC,IAAI,CAAA;AAC3E,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,cAAc,CAAC,KAAc;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,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,CAAC,UAAU,CAAC,CAAA;IAEpD,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAA;IAE5B,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAC,CAAE,CAAC,IAAI,IAAI,CAAA;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAW;IAC5C,MAAM,UAAU,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAA;IAE5C,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAA;IAE7B,OAAO,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,CAAA;AAC7B,CAAC"}
@@ -25,8 +25,8 @@ export interface CanadianProvinceInfo {
25
25
  french: string;
26
26
  }
27
27
  /**
28
- * ISO 3166-2:CA code → province/territory info, for all 13 subdivisions (10 provinces + 3
29
- * territories). Codes are the official subdivision codes minus the `CA-` prefix.
28
+ * ISO 3166-2:CA code → province/territory info, for all 13 subdivisions (10 provinces + 3 territories). Codes are the
29
+ * official subdivision codes minus the `CA-` prefix.
30
30
  */
31
31
  export declare const CA_PROVINCES: {
32
32
  readonly AB: {
@@ -100,15 +100,15 @@ export type CanadianProvinceCode = keyof typeof CA_PROVINCES;
100
100
  /** Type-predicate for an ISO 3166-2:CA province/territory code. Case-insensitive. */
101
101
  export declare function isCanadianProvinceCode(input: unknown): input is CanadianProvinceCode;
102
102
  /**
103
- * Folded province name (English or French) / code → ISO 3166-2:CA code. Built diacritic-insensitive
104
- * so both co-official names map regardless of accents: `Québec`, `Quebec`, and an unaccented
105
- * `Nouvelle-Ecosse` all resolve. The two-name design is the Canadian wrinkle — unlike the German
106
- * lookup's English exonym, the French form here is a name a real address may legitimately use.
103
+ * Folded province name (English or French) / code → ISO 3166-2:CA code. Built diacritic-insensitive so both co-official
104
+ * names map regardless of accents: `Québec`, `Quebec`, and an unaccented `Nouvelle-Ecosse` all resolve. The two-name
105
+ * design is the Canadian wrinkle — unlike the German lookup's English exonym, the French form here is a name a real
106
+ * address may legitimately use.
107
107
  */
108
108
  export declare const CA_PROVINCE_NAME_TO_CODE: ReadonlyMap<string, CanadianProvinceCode>;
109
109
  /**
110
- * Resolve a Canadian province/territory surface form (ISO code, English name, or French name,
111
- * accents optional) to its ISO code; null if unknown.
110
+ * Resolve a Canadian province/territory surface form (ISO code, English name, or French name, accents optional) to its
111
+ * ISO code; null if unknown.
112
112
  */
113
113
  export declare function lookupCanadianProvince(input: string | null | undefined): CanadianProvinceCode | null;
114
114
  //# sourceMappingURL=province.d.ts.map