@mailwoman/codex 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/country/country.d.ts +4 -2
- package/out/country/country.d.ts.map +1 -1
- package/out/country/country.js +4 -2
- package/out/country/country.js.map +1 -1
- package/out/nz/delivery-service.d.ts +61 -11
- package/out/nz/delivery-service.d.ts.map +1 -1
- package/out/nz/delivery-service.js +60 -12
- package/out/nz/delivery-service.js.map +1 -1
- package/package.json +1 -1
package/out/country/country.d.ts
CHANGED
|
@@ -58,8 +58,10 @@ export interface CountryMatch {
|
|
|
58
58
|
export declare function matchCountry(token: string | null | undefined): CountryMatch | null;
|
|
59
59
|
/** Case-insensitive check: is the token any recognized country form? */
|
|
60
60
|
export declare function isCountryToken(token: unknown): boolean;
|
|
61
|
-
/**
|
|
62
|
-
|
|
61
|
+
/**
|
|
62
|
+
* The preferred render forms for an alpha-2 (canonical first), for synth shards. Empty if none
|
|
63
|
+
* curated.
|
|
64
|
+
*/
|
|
63
65
|
export declare function countrySurfaceForms(iso2: string): readonly string[];
|
|
64
66
|
export { Alpha3ToCountryRecord, CountryISO2 };
|
|
65
67
|
export type { CountryISO3, CountryName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country.d.ts","sourceRoot":"","sources":["../../country/country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AACjF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;CAgB6B,CAAA;AAE/D,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,qBAAqB,CAAA;AAEnE,sFAAsF;AACtF,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAE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G,IAAI,CAKlF;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAEnE;AAED,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA"}
|
package/out/country/country.js
CHANGED
|
@@ -83,8 +83,10 @@ export function matchCountry(token) {
|
|
|
83
83
|
export function isCountryToken(token) {
|
|
84
84
|
return typeof token === "string" && COUNTRY_LOOKUP.has(token.trim().toLowerCase());
|
|
85
85
|
}
|
|
86
|
-
/**
|
|
87
|
-
|
|
86
|
+
/**
|
|
87
|
+
* The preferred render forms for an alpha-2 (canonical first), for synth shards. Empty if none
|
|
88
|
+
* curated.
|
|
89
|
+
*/
|
|
88
90
|
export function countrySurfaceForms(iso2) {
|
|
89
91
|
return COUNTRY_SURFACE_FORMS[iso2.toUpperCase()] ?? [];
|
|
90
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country.js","sourceRoot":"","sources":["../../country/country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAA;AACjF,OAAO,EAAoB,MAAM,YAAY,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC,EAAE,EAAE,CAAC,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,0BAA0B,EAAE,SAAS,CAAC;IAC3F,EAAE,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,6BAA6B,CAAC;IAC1E,EAAE,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC;IAC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QAAQ;QAAE,OAAO,IAAI,CAAA;IACpD,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;IAC3D,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAA;AAC1E,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,cAAc,CAAC,KAAc;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;AACnF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC/C,OAAQ,qBAA2D,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;AAC9F,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* NZ Post delivery-service types — the second half of the Commonwealth po_box vocabulary: `PO Box
|
|
7
|
-
* 24999`, `Private Bag 106999`, `CMB B99`, plus the identifier-less counter services
|
|
7
|
+
* 24999`, `Private Bag 106999`, `CMB B99`, plus the identifier-less counter services, plus the
|
|
8
|
+
* colloquial "Private Box" alias documented here for recognition with its 'invalid' citation.
|
|
8
9
|
*
|
|
9
10
|
* Sourcing (accessed 2026-06-11):
|
|
10
11
|
*
|
|
@@ -25,10 +26,17 @@
|
|
|
25
26
|
* punctuation-free".
|
|
26
27
|
*
|
|
27
28
|
* All six types are CURRENT in the October 2021 ADV358 (including CMB — no legacy flag is needed
|
|
28
|
-
* for the NZ slice).
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* for the NZ slice).
|
|
30
|
+
*
|
|
31
|
+
* **"Private Box" — colloquial alias, officially invalid:** ADV358 does not list "Private Box" as a
|
|
32
|
+
* Delivery Service Type and NZ Post's live standards pages (addressing-standards, how-to-address-
|
|
33
|
+
* mail, accessed 2026-06-11) name only the six types above. However, real NZ mail and the postal
|
|
34
|
+
* arena's gold rows carry "Private Box" as a colloquial synonym for a numbered PO Box (same
|
|
35
|
+
* numbered format, different label). Operator ruling 2026-06-11: "Private Box = recognize-as-used
|
|
36
|
+
* — codex documents it unofficial/colloquial WITH the 'officially invalid' citation; the shard
|
|
37
|
+
* teaches recognition (validity and recognition are separate disciplines, same as the AU legacy
|
|
38
|
+
* flags)." This is encoded in {@link NZ_PRIVATE_BOX_ALIAS} — a distinct export from
|
|
39
|
+
* {@link NZ_DELIVERY_SERVICE_TYPES} so callers can choose whether to include the unofficial form.
|
|
32
40
|
* @see {@link https://www.nzpost.co.nz/sites/nz/files/2021-10/adv358-address-standards.pdf NZ Post Address Standards (ADV358, Oct 2021)}
|
|
33
41
|
* @see {@link https://www.nzpost.co.nz/business/shipping-in-nz/addressing-standards NZ Post addressing standards}
|
|
34
42
|
* @see {@link https://www.nzpost.co.nz/personal/sending-in-nz/how-to-address-mail NZ Post — how to address mail}
|
|
@@ -76,20 +84,62 @@ export declare const NZ_DELIVERY_SERVICE_TYPES: readonly [{
|
|
|
76
84
|
}];
|
|
77
85
|
/** A canonical NZ Delivery Service Type. */
|
|
78
86
|
export type NzDeliveryServiceTypeName = (typeof NZ_DELIVERY_SERVICE_TYPES)[number]["type"];
|
|
87
|
+
/**
|
|
88
|
+
* Metadata for the colloquial "Private Box" alias (see the module header and operator ruling
|
|
89
|
+
* 2026-06-11). Kept separate from {@link NZ_DELIVERY_SERVICE_TYPES} because it is NOT a valid ADV358
|
|
90
|
+
* Delivery Service Type — recognition and validity are separate concerns.
|
|
91
|
+
*
|
|
92
|
+
* Sourcing: ADV358 (Oct 2021) omits "Private Box" from its Delivery Service Type list entirely. NZ
|
|
93
|
+
* Post's live standards pages (nzpost.co.nz/business/shipping-in-nz/addressing-standards and
|
|
94
|
+
* nzpost.co.nz/personal/sending-in-nz/how-to-address-mail, accessed 2026-06-11) do not list it as a
|
|
95
|
+
* valid type. Real NZ mail and the postal arena's gold rows nonetheless carry it as a colloquial
|
|
96
|
+
* synonym for a numbered PO Box. Operator ruling 2026-06-11 authorizes its inclusion here for
|
|
97
|
+
* recognition only, with this citation; corpus synthesis should treat it as a non-prescriptive
|
|
98
|
+
* form.
|
|
99
|
+
*/
|
|
100
|
+
export declare const NZ_PRIVATE_BOX_ALIAS: {
|
|
101
|
+
/** The surface form as it appears on real mail and in postal-arena gold rows. */
|
|
102
|
+
readonly type: "Private Box";
|
|
103
|
+
/**
|
|
104
|
+
* The description of validity status — NOT a valid ADV358 Delivery Service Type; a colloquial NZ
|
|
105
|
+
* synonym for a numbered PO Box (same format as "PO Box <number>").
|
|
106
|
+
*/
|
|
107
|
+
readonly description: "Colloquial NZ synonym for a numbered PO Box — NOT a valid ADV358 Delivery Service Type";
|
|
108
|
+
/** Identifier rule mirrors PO Box: a number is expected when the alias is used with one. */
|
|
109
|
+
readonly identifier: "required-if-allocated";
|
|
110
|
+
/** True — this form is NOT valid per ADV358 or NZ Post's live standards pages (accessed
|
|
111
|
+
2026-06-11). */
|
|
112
|
+
readonly officiallyInvalid: true;
|
|
113
|
+
};
|
|
114
|
+
/** Extended type name union including the colloquial alias recognized for parsing. */
|
|
115
|
+
export type NzDeliveryServiceMatchTypeName = NzDeliveryServiceTypeName | "Private Box";
|
|
79
116
|
/** Result of an NZ delivery-service parse. */
|
|
80
117
|
export interface NzDeliveryServiceMatch {
|
|
81
|
-
/** The designator phrase as it appeared ("PO Box", "private bag"). */
|
|
118
|
+
/** The designator phrase as it appeared ("PO Box", "private bag", "Private Box"). */
|
|
82
119
|
matched: string;
|
|
83
|
-
/**
|
|
84
|
-
|
|
120
|
+
/**
|
|
121
|
+
* The canonical Delivery Service Type or recognized alias ("PO Box", "Private Bag", "CMB", …,
|
|
122
|
+
* "Private Box"). When `type` is "Private Box", `colloquial` is true and `officiallyInvalid` is
|
|
123
|
+
* true — the form is not a valid ADV358 type.
|
|
124
|
+
*/
|
|
125
|
+
type: NzDeliveryServiceMatchTypeName;
|
|
85
126
|
/** The Delivery Service Identifier when present ("24999", "B99"). */
|
|
86
127
|
id?: string;
|
|
128
|
+
/**
|
|
129
|
+
* True when the matched form is the colloquial "Private Box" alias — not a valid ADV358 Delivery
|
|
130
|
+
* Service Type. Absent (undefined) for all standard ADV358 types.
|
|
131
|
+
*/
|
|
132
|
+
colloquial?: true;
|
|
87
133
|
}
|
|
88
134
|
/**
|
|
89
135
|
* If `input` is a standalone NZ delivery-service phrase ("PO Box 24999", "Private Bag 106999", "CMB
|
|
90
|
-
* B99", bare "Private Bag", "Counter Delivery"), return the canonical type and
|
|
91
|
-
* otherwise — including for "PB 39990" (an error of form per ADV358)
|
|
92
|
-
*
|
|
136
|
+
* B99", bare "Private Bag", "Counter Delivery", "Private Box 102"), return the canonical type and
|
|
137
|
+
* identifier. Null otherwise — including for "PB 39990" (an error of form per ADV358).
|
|
138
|
+
*
|
|
139
|
+
* When `type` is "Private Box", the result carries `colloquial: true` — indicating the colloquial
|
|
140
|
+
* alias (not an ADV358 Delivery Service Type; see {@link NZ_PRIVATE_BOX_ALIAS} and operator ruling
|
|
141
|
+
* 2026-06-11). Callers that want only formally-valid ADV358 types should check
|
|
142
|
+
* `!result.colloquial`.
|
|
93
143
|
*/
|
|
94
144
|
export declare function matchNzDeliveryService(input: unknown): NzDeliveryServiceMatch | null;
|
|
95
145
|
/** Type-predicate: does the input look like a standalone NZ delivery-service address line? */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-service.d.ts","sourceRoot":"","sources":["../../nz/delivery-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delivery-service.d.ts","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CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhE"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* NZ Post delivery-service types — the second half of the Commonwealth po_box vocabulary: `PO Box
|
|
7
|
-
* 24999`, `Private Bag 106999`, `CMB B99`, plus the identifier-less counter services
|
|
7
|
+
* 24999`, `Private Bag 106999`, `CMB B99`, plus the identifier-less counter services, plus the
|
|
8
|
+
* colloquial "Private Box" alias documented here for recognition with its 'invalid' citation.
|
|
8
9
|
*
|
|
9
10
|
* Sourcing (accessed 2026-06-11):
|
|
10
11
|
*
|
|
@@ -25,10 +26,17 @@
|
|
|
25
26
|
* punctuation-free".
|
|
26
27
|
*
|
|
27
28
|
* All six types are CURRENT in the October 2021 ADV358 (including CMB — no legacy flag is needed
|
|
28
|
-
* for the NZ slice).
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* for the NZ slice).
|
|
30
|
+
*
|
|
31
|
+
* **"Private Box" — colloquial alias, officially invalid:** ADV358 does not list "Private Box" as a
|
|
32
|
+
* Delivery Service Type and NZ Post's live standards pages (addressing-standards, how-to-address-
|
|
33
|
+
* mail, accessed 2026-06-11) name only the six types above. However, real NZ mail and the postal
|
|
34
|
+
* arena's gold rows carry "Private Box" as a colloquial synonym for a numbered PO Box (same
|
|
35
|
+
* numbered format, different label). Operator ruling 2026-06-11: "Private Box = recognize-as-used
|
|
36
|
+
* — codex documents it unofficial/colloquial WITH the 'officially invalid' citation; the shard
|
|
37
|
+
* teaches recognition (validity and recognition are separate disciplines, same as the AU legacy
|
|
38
|
+
* flags)." This is encoded in {@link NZ_PRIVATE_BOX_ALIAS} — a distinct export from
|
|
39
|
+
* {@link NZ_DELIVERY_SERVICE_TYPES} so callers can choose whether to include the unofficial form.
|
|
32
40
|
* @see {@link https://www.nzpost.co.nz/sites/nz/files/2021-10/adv358-address-standards.pdf NZ Post Address Standards (ADV358, Oct 2021)}
|
|
33
41
|
* @see {@link https://www.nzpost.co.nz/business/shipping-in-nz/addressing-standards NZ Post addressing standards}
|
|
34
42
|
* @see {@link https://www.nzpost.co.nz/personal/sending-in-nz/how-to-address-mail NZ Post — how to address mail}
|
|
@@ -54,21 +62,56 @@ export const NZ_DELIVERY_SERVICE_TYPES = [
|
|
|
54
62
|
identifier: "not-used",
|
|
55
63
|
},
|
|
56
64
|
];
|
|
65
|
+
/**
|
|
66
|
+
* Metadata for the colloquial "Private Box" alias (see the module header and operator ruling
|
|
67
|
+
* 2026-06-11). Kept separate from {@link NZ_DELIVERY_SERVICE_TYPES} because it is NOT a valid ADV358
|
|
68
|
+
* Delivery Service Type — recognition and validity are separate concerns.
|
|
69
|
+
*
|
|
70
|
+
* Sourcing: ADV358 (Oct 2021) omits "Private Box" from its Delivery Service Type list entirely. NZ
|
|
71
|
+
* Post's live standards pages (nzpost.co.nz/business/shipping-in-nz/addressing-standards and
|
|
72
|
+
* nzpost.co.nz/personal/sending-in-nz/how-to-address-mail, accessed 2026-06-11) do not list it as a
|
|
73
|
+
* valid type. Real NZ mail and the postal arena's gold rows nonetheless carry it as a colloquial
|
|
74
|
+
* synonym for a numbered PO Box. Operator ruling 2026-06-11 authorizes its inclusion here for
|
|
75
|
+
* recognition only, with this citation; corpus synthesis should treat it as a non-prescriptive
|
|
76
|
+
* form.
|
|
77
|
+
*/
|
|
78
|
+
export const NZ_PRIVATE_BOX_ALIAS = {
|
|
79
|
+
/** The surface form as it appears on real mail and in postal-arena gold rows. */
|
|
80
|
+
type: "Private Box",
|
|
81
|
+
/**
|
|
82
|
+
* The description of validity status — NOT a valid ADV358 Delivery Service Type; a colloquial NZ
|
|
83
|
+
* synonym for a numbered PO Box (same format as "PO Box <number>").
|
|
84
|
+
*/
|
|
85
|
+
description: "Colloquial NZ synonym for a numbered PO Box — NOT a valid ADV358 Delivery Service Type",
|
|
86
|
+
/** Identifier rule mirrors PO Box: a number is expected when the alias is used with one. */
|
|
87
|
+
identifier: "required-if-allocated",
|
|
88
|
+
/** True — this form is NOT valid per ADV358 or NZ Post's live standards pages (accessed
|
|
89
|
+
2026-06-11). */
|
|
90
|
+
officiallyInvalid: true,
|
|
91
|
+
};
|
|
57
92
|
/**
|
|
58
93
|
* Per-type surface patterns (designator phrase only). Recognition is deliberately wider than the
|
|
59
94
|
* prescriptive standard — mail in the wild writes "P.O. Box" even though ADV358 says `PO` is
|
|
60
|
-
* punctuation-free — but it does NOT admit forms the standard names as errors of TYPE (`PB`)
|
|
61
|
-
*
|
|
95
|
+
* punctuation-free — but it does NOT admit forms the standard names as errors of TYPE (`PB`).
|
|
96
|
+
*
|
|
97
|
+
* The colloquial "Private Box" alias is included for recognition (see {@link NZ_PRIVATE_BOX_ALIAS}
|
|
98
|
+
* and operator ruling 2026-06-11); it maps to a distinct synthetic type string so callers can
|
|
99
|
+
* distinguish it from the ADV358 types.
|
|
62
100
|
*/
|
|
63
101
|
const TYPE_PATTERNS = [
|
|
64
102
|
["PO Box", String.raw `p\.?\s*o\.?\s*box|post\s+box`],
|
|
65
103
|
["Private Bag", String.raw `private\s+bag`],
|
|
104
|
+
["Private Box", String.raw `private\s+box`],
|
|
66
105
|
["Response Bag", String.raw `response\s+bag`],
|
|
67
106
|
["CMB", String.raw `community\s+mail\s+box|cmb`],
|
|
68
107
|
["Counter Delivery", String.raw `counter\s+delivery`],
|
|
69
108
|
["Poste Restante", String.raw `poste\s+restante`],
|
|
70
109
|
];
|
|
71
|
-
const IDENTIFIER_RULES = new Map(
|
|
110
|
+
const IDENTIFIER_RULES = new Map([
|
|
111
|
+
...NZ_DELIVERY_SERVICE_TYPES.map((t) => [t.type, t.identifier]),
|
|
112
|
+
// "Private Box" mirrors PO Box identifier rules (required-if-allocated) per the alias metadata.
|
|
113
|
+
["Private Box", NZ_PRIVATE_BOX_ALIAS.identifier],
|
|
114
|
+
]);
|
|
72
115
|
// One anchored regex per type. The identifier shape follows ADV358 (alphanumeric, no spaces or
|
|
73
116
|
// separators — `24999`, `B99`); the identifier-less counter services take no tail at all.
|
|
74
117
|
const MATCHERS = TYPE_PATTERNS.map(([type, src]) => {
|
|
@@ -78,9 +121,13 @@ const MATCHERS = TYPE_PATTERNS.map(([type, src]) => {
|
|
|
78
121
|
});
|
|
79
122
|
/**
|
|
80
123
|
* If `input` is a standalone NZ delivery-service phrase ("PO Box 24999", "Private Bag 106999", "CMB
|
|
81
|
-
* B99", bare "Private Bag", "Counter Delivery"), return the canonical type and
|
|
82
|
-
* otherwise — including for "PB 39990" (an error of form per ADV358)
|
|
83
|
-
*
|
|
124
|
+
* B99", bare "Private Bag", "Counter Delivery", "Private Box 102"), return the canonical type and
|
|
125
|
+
* identifier. Null otherwise — including for "PB 39990" (an error of form per ADV358).
|
|
126
|
+
*
|
|
127
|
+
* When `type` is "Private Box", the result carries `colloquial: true` — indicating the colloquial
|
|
128
|
+
* alias (not an ADV358 Delivery Service Type; see {@link NZ_PRIVATE_BOX_ALIAS} and operator ruling
|
|
129
|
+
* 2026-06-11). Callers that want only formally-valid ADV358 types should check
|
|
130
|
+
* `!result.colloquial`.
|
|
84
131
|
*/
|
|
85
132
|
export function matchNzDeliveryService(input) {
|
|
86
133
|
if (typeof input !== "string")
|
|
@@ -89,7 +136,8 @@ export function matchNzDeliveryService(input) {
|
|
|
89
136
|
const m = re.exec(input);
|
|
90
137
|
if (!m)
|
|
91
138
|
continue;
|
|
92
|
-
|
|
139
|
+
const colloquial = type === "Private Box" ? { colloquial: true } : {};
|
|
140
|
+
return { matched: m[1].trim(), type, ...(m[2] ? { id: m[2] } : {}), ...colloquial };
|
|
93
141
|
}
|
|
94
142
|
return null;
|
|
95
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-service.js","sourceRoot":"","sources":["../../nz/delivery-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delivery-service.js","sourceRoot":"","sources":["../../nz/delivery-service.ts"],"names":[],"mappings":"AAA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ACxB,IAAI,CAAC,CAAC;YAAE,SAAQ;QAChB,MAAM,UAAU,GAAG,IAAI,KAAK,aAAa,CAAC,CAAC,CAAE,EAAE,UAAU,EAAE,IAAI,EAAY,CAAC,CAAC,CAAC,EAAE,CAAA;QAChF,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,UAAU,EAAE,CAAA;IACrF,CAAC;IACD,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;IACvC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IACpB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/codex",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "Per-address-system postal reference data + branded types (USPS street suffixes, US ZIP codes). Pure, zero-runtime-dep — the shared canonical home for postal-system primitives the parser, resolver, and synthesis layers all reach for.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|