@mailwoman/codex 9.1.0 → 9.3.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 (287) hide show
  1. package/README.md +51 -8
  2. package/{address-system-conventions.ts → lib/address-system-conventions.ts} +9 -9
  3. package/{au → lib/au}/index.ts +4 -4
  4. package/{ca → lib/ca}/index.ts +4 -4
  5. package/{ca → lib/ca}/postal-code.ts +12 -12
  6. package/{ca → lib/ca}/province.ts +1 -1
  7. package/{ca → lib/ca}/street-type.ts +10 -12
  8. package/{country → lib/country}/codes.ts +1 -1
  9. package/{country → lib/country}/country.ts +43 -14
  10. package/lib/country/display-names.ts +150 -0
  11. package/lib/country/index.ts +17 -0
  12. package/lib/country/population.ts +265 -0
  13. package/{country → lib/country}/reference.ts +2 -2
  14. package/{country → lib/country}/subdivision.ts +62 -3
  15. package/{de → lib/de}/index.ts +4 -4
  16. package/{de → lib/de}/postleitzahl.ts +3 -3
  17. package/{es → lib/es}/codigo-postal.ts +24 -6
  18. package/{es → lib/es}/index.ts +1 -1
  19. package/{fr → lib/fr}/cedex.ts +1 -1
  20. package/{fr → lib/fr}/code-postal.ts +8 -8
  21. package/{fr → lib/fr}/departement.ts +5 -2
  22. package/{fr → lib/fr}/index.ts +6 -6
  23. package/{fr → lib/fr}/region.ts +1 -1
  24. package/{fr → lib/fr}/voie.ts +5 -13
  25. package/{gb → lib/gb}/country.ts +2 -10
  26. package/{gb → lib/gb}/index.ts +4 -4
  27. package/{gb → lib/gb}/postcode-area.ts +1 -1
  28. package/{gb → lib/gb}/street-type.ts +1 -1
  29. package/{index.ts → lib/index.ts} +22 -12
  30. package/{it → lib/it}/cap.ts +23 -5
  31. package/{it → lib/it}/index.ts +1 -1
  32. package/{jp → lib/jp}/index.ts +4 -4
  33. package/{jp → lib/jp}/postal-code.ts +11 -11
  34. package/{jp → lib/jp}/prefecture.ts +7 -5
  35. package/{normalize.ts → lib/normalize.ts} +15 -1
  36. package/{nz → lib/nz}/delivery-service.ts +1 -1
  37. package/{nz → lib/nz}/index.ts +2 -2
  38. package/lib/postcode-systems.ts +198 -0
  39. package/{tools → lib/tools}/build-country-surface-lexicon.ts +10 -9
  40. package/{tools → lib/tools}/export-country-surfaces.ts +8 -8
  41. package/lib/tools/generate-country-population.ts +142 -0
  42. package/{tools → lib/tools}/generate-country-reference.ts +8 -7
  43. package/{tools → lib/tools}/generate-official-languages.ts +15 -13
  44. package/{tools → lib/tools}/index.ts +4 -4
  45. package/{us → lib/us}/index.ts +8 -8
  46. package/{us → lib/us}/po-box.ts +1 -1
  47. package/{us → lib/us}/street-directional.ts +2 -2
  48. package/{us → lib/us}/street-suffix.ts +1 -1
  49. package/{us → lib/us}/unit-designator.ts +1 -1
  50. package/{us → lib/us}/zipcode.ts +2 -2
  51. package/out/address-system-conventions.d.ts +1 -1
  52. package/out/address-system-conventions.d.ts.map +1 -1
  53. package/out/address-system-conventions.js +8 -8
  54. package/out/address-system-conventions.js.map +1 -1
  55. package/out/au/delivery-service.d.ts.map +1 -1
  56. package/out/au/delivery-service.js.map +1 -1
  57. package/out/au/index.d.ts +4 -4
  58. package/out/au/index.d.ts.map +1 -1
  59. package/out/au/index.js +4 -4
  60. package/out/au/index.js.map +1 -1
  61. package/out/au/level-designator.d.ts.map +1 -1
  62. package/out/au/level-designator.js.map +1 -1
  63. package/out/au/postcode.d.ts.map +1 -1
  64. package/out/au/postcode.js.map +1 -1
  65. package/out/au/state.d.ts.map +1 -1
  66. package/out/au/state.js.map +1 -1
  67. package/out/ca/index.d.ts +4 -4
  68. package/out/ca/index.d.ts.map +1 -1
  69. package/out/ca/index.js +4 -4
  70. package/out/ca/index.js.map +1 -1
  71. package/out/ca/postal-code.d.ts +11 -11
  72. package/out/ca/postal-code.d.ts.map +1 -1
  73. package/out/ca/postal-code.js +9 -9
  74. package/out/ca/postal-code.js.map +1 -1
  75. package/out/ca/province.d.ts.map +1 -1
  76. package/out/ca/province.js +1 -1
  77. package/out/ca/province.js.map +1 -1
  78. package/out/ca/street-type.d.ts.map +1 -1
  79. package/out/ca/street-type.js +9 -12
  80. package/out/ca/street-type.js.map +1 -1
  81. package/out/country/codes.d.ts.map +1 -1
  82. package/out/country/codes.js.map +1 -1
  83. package/out/country/country.d.ts +13 -11
  84. package/out/country/country.d.ts.map +1 -1
  85. package/out/country/country.js +35 -13
  86. package/out/country/country.js.map +1 -1
  87. package/out/country/display-names.d.ts +67 -0
  88. package/out/country/display-names.d.ts.map +1 -0
  89. package/out/country/display-names.js +118 -0
  90. package/out/country/display-names.js.map +1 -0
  91. package/out/country/index.d.ts +10 -8
  92. package/out/country/index.d.ts.map +1 -1
  93. package/out/country/index.js +10 -8
  94. package/out/country/index.js.map +1 -1
  95. package/out/country/names.d.ts.map +1 -1
  96. package/out/country/names.js.map +1 -1
  97. package/out/country/official-languages.d.ts.map +1 -1
  98. package/out/country/official-languages.js.map +1 -1
  99. package/out/country/population.d.ts +16 -0
  100. package/out/country/population.d.ts.map +1 -0
  101. package/out/country/population.js +265 -0
  102. package/out/country/population.js.map +1 -0
  103. package/out/country/reference-data.d.ts.map +1 -1
  104. package/out/country/reference-data.js.map +1 -1
  105. package/out/country/reference.d.ts +1 -1
  106. package/out/country/reference.d.ts.map +1 -1
  107. package/out/country/reference.js +2 -2
  108. package/out/country/reference.js.map +1 -1
  109. package/out/country/subdivision.d.ts +7 -0
  110. package/out/country/subdivision.d.ts.map +1 -1
  111. package/out/country/subdivision.js +52 -3
  112. package/out/country/subdivision.js.map +1 -1
  113. package/out/de/bundesland.d.ts.map +1 -1
  114. package/out/de/bundesland.js.map +1 -1
  115. package/out/de/index.d.ts +4 -4
  116. package/out/de/index.d.ts.map +1 -1
  117. package/out/de/index.js +4 -4
  118. package/out/de/index.js.map +1 -1
  119. package/out/de/postleitzahl.d.ts +3 -3
  120. package/out/de/postleitzahl.d.ts.map +1 -1
  121. package/out/de/postleitzahl.js +2 -2
  122. package/out/de/postleitzahl.js.map +1 -1
  123. package/out/de/street-type.d.ts.map +1 -1
  124. package/out/de/street-type.js.map +1 -1
  125. package/out/es/codigo-postal.d.ts +13 -2
  126. package/out/es/codigo-postal.d.ts.map +1 -1
  127. package/out/es/codigo-postal.js +21 -4
  128. package/out/es/codigo-postal.js.map +1 -1
  129. package/out/es/index.d.ts +1 -1
  130. package/out/es/index.d.ts.map +1 -1
  131. package/out/es/index.js +1 -1
  132. package/out/es/index.js.map +1 -1
  133. package/out/fr/cedex.d.ts +1 -1
  134. package/out/fr/cedex.d.ts.map +1 -1
  135. package/out/fr/cedex.js +1 -1
  136. package/out/fr/cedex.js.map +1 -1
  137. package/out/fr/code-postal.d.ts +7 -7
  138. package/out/fr/code-postal.d.ts.map +1 -1
  139. package/out/fr/code-postal.js +8 -8
  140. package/out/fr/code-postal.js.map +1 -1
  141. package/out/fr/departement.d.ts +2 -2
  142. package/out/fr/departement.d.ts.map +1 -1
  143. package/out/fr/departement.js +3 -0
  144. package/out/fr/departement.js.map +1 -1
  145. package/out/fr/index.d.ts +6 -6
  146. package/out/fr/index.d.ts.map +1 -1
  147. package/out/fr/index.js +6 -6
  148. package/out/fr/index.js.map +1 -1
  149. package/out/fr/region.d.ts.map +1 -1
  150. package/out/fr/region.js +1 -1
  151. package/out/fr/region.js.map +1 -1
  152. package/out/fr/voie.d.ts.map +1 -1
  153. package/out/fr/voie.js +4 -11
  154. package/out/fr/voie.js.map +1 -1
  155. package/out/gb/country.d.ts.map +1 -1
  156. package/out/gb/country.js +1 -9
  157. package/out/gb/country.js.map +1 -1
  158. package/out/gb/index.d.ts +4 -4
  159. package/out/gb/index.d.ts.map +1 -1
  160. package/out/gb/index.js +4 -4
  161. package/out/gb/index.js.map +1 -1
  162. package/out/gb/postcode-area.d.ts +1 -1
  163. package/out/gb/postcode-area.d.ts.map +1 -1
  164. package/out/gb/postcode-area.js.map +1 -1
  165. package/out/gb/postcode.d.ts.map +1 -1
  166. package/out/gb/postcode.js.map +1 -1
  167. package/out/gb/street-type.d.ts +1 -1
  168. package/out/gb/street-type.d.ts.map +1 -1
  169. package/out/gb/street-type.js +1 -1
  170. package/out/gb/street-type.js.map +1 -1
  171. package/out/index.d.ts +12 -12
  172. package/out/index.d.ts.map +1 -1
  173. package/out/index.js +12 -12
  174. package/out/index.js.map +1 -1
  175. package/out/it/cap.d.ts +13 -2
  176. package/out/it/cap.d.ts.map +1 -1
  177. package/out/it/cap.js +20 -3
  178. package/out/it/cap.js.map +1 -1
  179. package/out/it/index.d.ts +1 -1
  180. package/out/it/index.d.ts.map +1 -1
  181. package/out/it/index.js +1 -1
  182. package/out/it/index.js.map +1 -1
  183. package/out/jp/address-unit.d.ts.map +1 -1
  184. package/out/jp/address-unit.js.map +1 -1
  185. package/out/jp/index.d.ts +4 -4
  186. package/out/jp/index.d.ts.map +1 -1
  187. package/out/jp/index.js +4 -4
  188. package/out/jp/index.js.map +1 -1
  189. package/out/jp/postal-code.d.ts +11 -11
  190. package/out/jp/postal-code.d.ts.map +1 -1
  191. package/out/jp/postal-code.js +8 -8
  192. package/out/jp/postal-code.js.map +1 -1
  193. package/out/jp/prefecture.d.ts +4 -1
  194. package/out/jp/prefecture.d.ts.map +1 -1
  195. package/out/jp/prefecture.js +6 -5
  196. package/out/jp/prefecture.js.map +1 -1
  197. package/out/level-semantics.d.ts.map +1 -1
  198. package/out/level-semantics.js.map +1 -1
  199. package/out/normalize.d.ts +8 -0
  200. package/out/normalize.d.ts.map +1 -1
  201. package/out/normalize.js +14 -1
  202. package/out/normalize.js.map +1 -1
  203. package/out/nz/delivery-service.d.ts +1 -1
  204. package/out/nz/delivery-service.d.ts.map +1 -1
  205. package/out/nz/delivery-service.js +1 -1
  206. package/out/nz/delivery-service.js.map +1 -1
  207. package/out/nz/index.d.ts +2 -2
  208. package/out/nz/index.d.ts.map +1 -1
  209. package/out/nz/index.js +2 -2
  210. package/out/nz/index.js.map +1 -1
  211. package/out/nz/postcode.d.ts.map +1 -1
  212. package/out/nz/postcode.js.map +1 -1
  213. package/out/postcode-systems.d.ts +99 -4
  214. package/out/postcode-systems.d.ts.map +1 -1
  215. package/out/postcode-systems.js +132 -11
  216. package/out/postcode-systems.js.map +1 -1
  217. package/out/tools/build-country-surface-lexicon.d.ts +1 -1
  218. package/out/tools/build-country-surface-lexicon.d.ts.map +1 -1
  219. package/out/tools/build-country-surface-lexicon.js +10 -9
  220. package/out/tools/build-country-surface-lexicon.js.map +1 -1
  221. package/out/tools/export-country-surfaces.d.ts +1 -1
  222. package/out/tools/export-country-surfaces.d.ts.map +1 -1
  223. package/out/tools/export-country-surfaces.js +7 -7
  224. package/out/tools/export-country-surfaces.js.map +1 -1
  225. package/out/tools/generate-country-population.d.ts +42 -0
  226. package/out/tools/generate-country-population.d.ts.map +1 -0
  227. package/out/tools/generate-country-population.js +106 -0
  228. package/out/tools/generate-country-population.js.map +1 -0
  229. package/out/tools/generate-country-reference.d.ts.map +1 -1
  230. package/out/tools/generate-country-reference.js +8 -8
  231. package/out/tools/generate-country-reference.js.map +1 -1
  232. package/out/tools/generate-official-languages.d.ts.map +1 -1
  233. package/out/tools/generate-official-languages.js +14 -11
  234. package/out/tools/generate-official-languages.js.map +1 -1
  235. package/out/tools/index.d.ts +4 -4
  236. package/out/tools/index.d.ts.map +1 -1
  237. package/out/tools/index.js +4 -4
  238. package/out/tools/index.js.map +1 -1
  239. package/out/us/floor-designator.d.ts.map +1 -1
  240. package/out/us/floor-designator.js.map +1 -1
  241. package/out/us/index.d.ts +8 -8
  242. package/out/us/index.d.ts.map +1 -1
  243. package/out/us/index.js +8 -8
  244. package/out/us/index.js.map +1 -1
  245. package/out/us/military-address.d.ts.map +1 -1
  246. package/out/us/military-address.js.map +1 -1
  247. package/out/us/po-box.d.ts +1 -1
  248. package/out/us/po-box.d.ts.map +1 -1
  249. package/out/us/po-box.js +1 -1
  250. package/out/us/po-box.js.map +1 -1
  251. package/out/us/state.d.ts.map +1 -1
  252. package/out/us/state.js.map +1 -1
  253. package/out/us/street-directional.d.ts.map +1 -1
  254. package/out/us/street-directional.js +2 -2
  255. package/out/us/street-directional.js.map +1 -1
  256. package/out/us/street-suffix.d.ts +1 -1
  257. package/out/us/street-suffix.d.ts.map +1 -1
  258. package/out/us/street-suffix.js +1 -1
  259. package/out/us/street-suffix.js.map +1 -1
  260. package/out/us/unit-designator.d.ts +1 -1
  261. package/out/us/unit-designator.d.ts.map +1 -1
  262. package/out/us/unit-designator.js +1 -1
  263. package/out/us/unit-designator.js.map +1 -1
  264. package/out/us/zipcode.d.ts +2 -2
  265. package/out/us/zipcode.d.ts.map +1 -1
  266. package/out/us/zipcode.js +2 -2
  267. package/out/us/zipcode.js.map +1 -1
  268. package/package.json +129 -6
  269. package/country/index.ts +0 -15
  270. package/postcode-systems.ts +0 -70
  271. /package/{au → lib/au}/delivery-service.ts +0 -0
  272. /package/{au → lib/au}/level-designator.ts +0 -0
  273. /package/{au → lib/au}/postcode.ts +0 -0
  274. /package/{au → lib/au}/state.ts +0 -0
  275. /package/{country → lib/country}/names.ts +0 -0
  276. /package/{country → lib/country}/official-languages.ts +0 -0
  277. /package/{country → lib/country}/reference-data.ts +0 -0
  278. /package/{de → lib/de}/bundesland.ts +0 -0
  279. /package/{de → lib/de}/street-type.ts +0 -0
  280. /package/{gb → lib/gb}/postcode.ts +0 -0
  281. /package/{jp → lib/jp}/address-unit.ts +0 -0
  282. /package/{level-semantics.ts → lib/level-semantics.ts} +0 -0
  283. /package/{nz → lib/nz}/postcode.ts +0 -0
  284. /package/{us → lib/us}/floor-designator.ts +0 -0
  285. /package/{us → lib/us}/military-address.ts +0 -0
  286. /package/{us → lib/us}/state.ts +0 -0
  287. /package/{us → lib/us}/street-suffix.json +0 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mailwoman/codex",
3
- "version": "9.1.0",
3
+ "version": "9.3.0",
4
4
  "description": "Per-address-system postal reference data + branded types (USPS street suffixes, US ZIP codes). Pure, zero-runtime-dep — the shared canonical home for postal-system primitives the parser, resolver, and synthesis layers all reach for.",
5
5
  "license": "AGPL-3.0-only OR LicenseRef-Commercial",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/sister-software/mailwoman.git",
9
- "directory": "codex"
9
+ "directory": "packages/codex"
10
10
  },
11
11
  "files": [
12
12
  "out/**/*.js",
@@ -21,63 +21,124 @@
21
21
  "!*.test.tsx",
22
22
  "!**/*.test.ts",
23
23
  "!**/*.test.tsx",
24
- "us/street-suffix.json",
25
- "out/us/street-suffix.json"
24
+ "lib/us/street-suffix.json",
25
+ "out/us/street-suffix.json",
26
+ "!test/**"
26
27
  ],
27
28
  "type": "module",
29
+ "imports": {
30
+ "#*": {
31
+ "types": "./out/*.d.ts",
32
+ "node": "./out/*.js",
33
+ "default": "./out/*.js"
34
+ }
35
+ },
28
36
  "exports": {
29
37
  "./package.json": "./package.json",
30
38
  ".": {
31
39
  "types": "./out/index.d.ts",
40
+ "node": "./out/index.js",
32
41
  "default": "./out/index.js"
33
42
  },
34
43
  "./country": {
35
44
  "types": "./out/country/index.d.ts",
45
+ "node": "./out/country/index.js",
36
46
  "default": "./out/country/index.js"
37
47
  },
38
48
  "./us": {
39
49
  "types": "./out/us/index.d.ts",
50
+ "node": "./out/us/index.js",
40
51
  "default": "./out/us/index.js"
41
52
  },
42
53
  "./de": {
43
54
  "types": "./out/de/index.d.ts",
55
+ "node": "./out/de/index.js",
44
56
  "default": "./out/de/index.js"
45
57
  },
46
58
  "./fr": {
47
59
  "types": "./out/fr/index.d.ts",
60
+ "node": "./out/fr/index.js",
48
61
  "default": "./out/fr/index.js"
49
62
  },
50
63
  "./ca": {
51
64
  "types": "./out/ca/index.d.ts",
65
+ "node": "./out/ca/index.js",
52
66
  "default": "./out/ca/index.js"
53
67
  },
54
68
  "./gb": {
55
69
  "types": "./out/gb/index.d.ts",
70
+ "node": "./out/gb/index.js",
56
71
  "default": "./out/gb/index.js"
57
72
  },
58
73
  "./jp": {
59
74
  "types": "./out/jp/index.d.ts",
75
+ "node": "./out/jp/index.js",
60
76
  "default": "./out/jp/index.js"
61
77
  },
62
78
  "./au": {
63
79
  "types": "./out/au/index.d.ts",
80
+ "node": "./out/au/index.js",
64
81
  "default": "./out/au/index.js"
65
82
  },
66
83
  "./nz": {
67
84
  "types": "./out/nz/index.d.ts",
85
+ "node": "./out/nz/index.js",
68
86
  "default": "./out/nz/index.js"
69
87
  },
70
88
  "./tools": {
71
89
  "types": "./out/tools/index.d.ts",
90
+ "node": "./out/tools/index.js",
72
91
  "default": "./out/tools/index.js"
73
92
  },
93
+ "./normalize": {
94
+ "types": "./out/normalize.d.ts",
95
+ "node": "./out/normalize.js",
96
+ "default": "./out/normalize.js"
97
+ },
74
98
  "./es": {
75
99
  "types": "./out/es/index.d.ts",
100
+ "node": "./out/es/index.js",
76
101
  "default": "./out/es/index.js"
77
102
  },
78
103
  "./it": {
79
104
  "types": "./out/it/index.d.ts",
105
+ "node": "./out/it/index.js",
80
106
  "default": "./out/it/index.js"
107
+ },
108
+ "./address-system-conventions": {
109
+ "types": "./out/address-system-conventions.d.ts",
110
+ "node": "./out/address-system-conventions.js",
111
+ "default": "./out/address-system-conventions.js"
112
+ },
113
+ "./level-semantics": {
114
+ "types": "./out/level-semantics.d.ts",
115
+ "node": "./out/level-semantics.js",
116
+ "default": "./out/level-semantics.js"
117
+ },
118
+ "./postcode-systems": {
119
+ "types": "./out/postcode-systems.d.ts",
120
+ "node": "./out/postcode-systems.js",
121
+ "default": "./out/postcode-systems.js"
122
+ },
123
+ "./us/floor-designator": {
124
+ "types": "./out/us/floor-designator.d.ts",
125
+ "node": "./out/us/floor-designator.js",
126
+ "default": "./out/us/floor-designator.js"
127
+ },
128
+ "./us/state": {
129
+ "types": "./out/us/state.d.ts",
130
+ "node": "./out/us/state.js",
131
+ "default": "./out/us/state.js"
132
+ },
133
+ "./us/street-suffix": {
134
+ "types": "./out/us/street-suffix.d.ts",
135
+ "node": "./out/us/street-suffix.js",
136
+ "default": "./out/us/street-suffix.js"
137
+ },
138
+ "./us/unit-designator": {
139
+ "types": "./out/us/unit-designator.d.ts",
140
+ "node": "./out/us/unit-designator.js",
141
+ "default": "./out/us/unit-designator.js"
81
142
  }
82
143
  },
83
144
  "publishConfig": {
@@ -86,62 +147,124 @@
86
147
  "./package.json": "./package.json",
87
148
  ".": {
88
149
  "types": "./out/index.d.ts",
150
+ "node": "./out/index.js",
89
151
  "default": "./out/index.js"
90
152
  },
91
153
  "./country": {
92
154
  "types": "./out/country/index.d.ts",
155
+ "node": "./out/country/index.js",
93
156
  "default": "./out/country/index.js"
94
157
  },
95
158
  "./us": {
96
159
  "types": "./out/us/index.d.ts",
160
+ "node": "./out/us/index.js",
97
161
  "default": "./out/us/index.js"
98
162
  },
99
163
  "./de": {
100
164
  "types": "./out/de/index.d.ts",
165
+ "node": "./out/de/index.js",
101
166
  "default": "./out/de/index.js"
102
167
  },
103
168
  "./fr": {
104
169
  "types": "./out/fr/index.d.ts",
170
+ "node": "./out/fr/index.js",
105
171
  "default": "./out/fr/index.js"
106
172
  },
107
173
  "./ca": {
108
174
  "types": "./out/ca/index.d.ts",
175
+ "node": "./out/ca/index.js",
109
176
  "default": "./out/ca/index.js"
110
177
  },
111
178
  "./gb": {
112
179
  "types": "./out/gb/index.d.ts",
180
+ "node": "./out/gb/index.js",
113
181
  "default": "./out/gb/index.js"
114
182
  },
115
183
  "./jp": {
116
184
  "types": "./out/jp/index.d.ts",
185
+ "node": "./out/jp/index.js",
117
186
  "default": "./out/jp/index.js"
118
187
  },
119
188
  "./au": {
120
189
  "types": "./out/au/index.d.ts",
190
+ "node": "./out/au/index.js",
121
191
  "default": "./out/au/index.js"
122
192
  },
123
193
  "./nz": {
124
194
  "types": "./out/nz/index.d.ts",
195
+ "node": "./out/nz/index.js",
125
196
  "default": "./out/nz/index.js"
126
197
  },
127
198
  "./tools": {
128
199
  "types": "./out/tools/index.d.ts",
200
+ "node": "./out/tools/index.js",
129
201
  "default": "./out/tools/index.js"
130
202
  },
203
+ "./normalize": {
204
+ "types": "./out/normalize.d.ts",
205
+ "node": "./out/normalize.js",
206
+ "default": "./out/normalize.js"
207
+ },
131
208
  "./es": {
132
209
  "types": "./out/es/index.d.ts",
210
+ "node": "./out/es/index.js",
133
211
  "default": "./out/es/index.js"
134
212
  },
135
213
  "./it": {
136
214
  "types": "./out/it/index.d.ts",
215
+ "node": "./out/it/index.js",
137
216
  "default": "./out/it/index.js"
217
+ },
218
+ "./address-system-conventions": {
219
+ "types": "./out/address-system-conventions.d.ts",
220
+ "node": "./out/address-system-conventions.js",
221
+ "default": "./out/address-system-conventions.js"
222
+ },
223
+ "./level-semantics": {
224
+ "types": "./out/level-semantics.d.ts",
225
+ "node": "./out/level-semantics.js",
226
+ "default": "./out/level-semantics.js"
227
+ },
228
+ "./postcode-systems": {
229
+ "types": "./out/postcode-systems.d.ts",
230
+ "node": "./out/postcode-systems.js",
231
+ "default": "./out/postcode-systems.js"
232
+ },
233
+ "./us/floor-designator": {
234
+ "types": "./out/us/floor-designator.d.ts",
235
+ "node": "./out/us/floor-designator.js",
236
+ "default": "./out/us/floor-designator.js"
237
+ },
238
+ "./us/state": {
239
+ "types": "./out/us/state.d.ts",
240
+ "node": "./out/us/state.js",
241
+ "default": "./out/us/state.js"
242
+ },
243
+ "./us/street-suffix": {
244
+ "types": "./out/us/street-suffix.d.ts",
245
+ "node": "./out/us/street-suffix.js",
246
+ "default": "./out/us/street-suffix.js"
247
+ },
248
+ "./us/unit-designator": {
249
+ "types": "./out/us/unit-designator.d.ts",
250
+ "node": "./out/us/unit-designator.js",
251
+ "default": "./out/us/unit-designator.js"
252
+ }
253
+ },
254
+ "imports": {
255
+ "#*": {
256
+ "types": "./out/*.d.ts",
257
+ "node": "./out/*.js",
258
+ "default": "./out/*.js"
138
259
  }
139
260
  }
140
261
  },
141
262
  "dependencies": {
142
- "type-fest": "^5.8.0"
263
+ "type-fest": "^5.9.0"
143
264
  },
144
265
  "devDependencies": {
145
- "@mailwoman/annotations": "9.1.0"
266
+ "@mailwoman/annotations": "9.3.0",
267
+ "@mailwoman/core": "9.3.0",
268
+ "path-ts": "^2.3.0"
146
269
  }
147
270
  }
package/country/index.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * ISO 3166-1 country reference + surface-form recognition (the `country` parity lever).
7
- */
8
-
9
- export * from "./codes.ts"
10
- export * from "./country.ts"
11
- export * from "./names.ts"
12
- export * from "./official-languages.ts"
13
- export * from "./reference-data.ts"
14
- export * from "./reference.ts"
15
- export * from "./subdivision.ts"
@@ -1,70 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * The inverse of the per-slice postcode patterns: given a postcode string, which address SYSTEMS
7
- * could it belong to? Each codex slice owns its own postcode shape (`us` accepts
8
- * `\d{5}(-\d{4})?`, `ca` accepts `A1A 1A1`, `jp` accepts `NNN-NNNN`, …); this is the single place
9
- * that asks all of them at once and collects the matches.
10
- *
11
- * It is the shared source of truth for "which systems can this shape be" — consumed by the postcode
12
- * anchor (to narrow which systems' street vocabularies it checks) and, in time, by the runtime
13
- * pipeline's locale gate (so its format→locale scoring derives from the same patterns rather than
14
- * a second, divergent copy). The point is to unify the DATA, not to couple the modules: callers
15
- * depend on this pure function, never on each other.
16
- *
17
- * Note this is a SHAPE test, not a gazetteer-membership test. A bare `68161` matches the US,
18
- * German, AND French 5-digit shapes, so it returns `["us", "de", "fr"]` — the shape alone cannot
19
- * split the numeric-postcode systems. The anchor uses real gazetteer membership for the finer
20
- * call; this function answers the coarser, model-free "which systems is this shape even eligible
21
- * for".
22
- */
23
-
24
- import { normalizeAuPostcode } from "./au/index.ts"
25
- import { normalizeCaPostalCode } from "./ca/index.ts"
26
- import { normalizePLZ } from "./de/index.ts"
27
- import { normalizeCodePostal } from "./fr/index.ts"
28
- import { normalizeUkPostcode } from "./gb/index.ts"
29
- import { normalizeJpPostalCode } from "./jp/index.ts"
30
- import { normalizeNZPostcode } from "./nz/index.ts"
31
- import { isZipCode } from "./us/index.ts"
32
-
33
- /**
34
- * A codex address-system code — the subpath under `@mailwoman/codex/<system>`.
35
- */
36
- export type SystemCode = "us" | "de" | "fr" | "ca" | "gb" | "jp" | "au" | "nz"
37
-
38
- /**
39
- * Per-system membership test: each entry returns true when the string is accepted by that system's own postcode shape
40
- * (after that system's normalization — so `D-68161` reaches `de`, `1012 LM` reaches nothing here since NL has no slice
41
- * yet, etc.). Ordered for a stable, alphabetical-ish result.
42
- */
43
- const SYSTEM_ACCEPTS: ReadonlyArray<readonly [SystemCode, (s: string) => boolean]> = [
44
- ["us", (s) => isZipCode(s)],
45
- ["de", (s) => normalizePLZ(s) !== null],
46
- ["fr", (s) => normalizeCodePostal(s) !== null],
47
- ["ca", (s) => normalizeCaPostalCode(s) !== null],
48
- ["gb", (s) => normalizeUkPostcode(s) !== null],
49
- ["jp", (s) => normalizeJpPostalCode(s) !== null],
50
- ["au", (s) => normalizeAuPostcode(s) !== null],
51
- ["nz", (s) => normalizeNZPostcode(s) !== null],
52
- ]
53
-
54
- /**
55
- * Every address system whose own postcode shape accepts `postcode`. Empty when no system recognizes the shape (e.g. a
56
- * bare `27`, or a 7-digit run). O(number of systems) — a handful of cheap regex tests, run only on the few
57
- * postcode-shaped spans an address contains.
58
- */
59
- export function candidateSystemsForPostcode(postcode: string): SystemCode[] {
60
- if (typeof postcode !== "string" || !postcode.length) return []
61
- const out: SystemCode[] = []
62
-
63
- for (const [system, accepts] of SYSTEM_ACCEPTS) {
64
- if (accepts(postcode)) {
65
- out.push(system)
66
- }
67
- }
68
-
69
- return out
70
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes