@mailwoman/registry 11.0.0 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/README.md +21 -6
  2. package/data/manifests/artifacts.json +35 -0
  3. package/data/manifests/coverage.json +63 -0
  4. package/data/manifests/sources.lock.json +12 -0
  5. package/data/normalized/language-subtags.json +18518 -0
  6. package/docs/data-policy.md +5 -5
  7. package/docs/performance.md +1 -1
  8. package/docs/rgy1.md +5 -5
  9. package/lib/artifacts/bcp47/extlang.fixture.json +260 -0
  10. package/lib/artifacts/bcp47/extlang.ts +32 -0
  11. package/lib/artifacts/bcp47/grandfathered.fixture.json +28 -0
  12. package/lib/artifacts/bcp47/grandfathered.ts +32 -0
  13. package/lib/artifacts/bcp47/language.fixture.json +8278 -0
  14. package/lib/artifacts/bcp47/language.ts +32 -0
  15. package/lib/artifacts/bcp47/redundant.fixture.json +69 -0
  16. package/lib/artifacts/bcp47/redundant.ts +32 -0
  17. package/lib/artifacts/bcp47/region.fixture.json +307 -0
  18. package/lib/artifacts/bcp47/region.ts +32 -0
  19. package/lib/artifacts/bcp47/script.fixture.json +227 -0
  20. package/lib/artifacts/bcp47/script.ts +32 -0
  21. package/lib/artifacts/bcp47/variant.fixture.json +141 -0
  22. package/lib/artifacts/bcp47/variant.ts +32 -0
  23. package/lib/artifacts/country-airport-collision.ts +7 -5
  24. package/lib/artifacts/iata-airport/membership.ts +7 -5
  25. package/lib/artifacts/iata-airport/records.ts +7 -5
  26. package/lib/artifacts/iso3166-1/alpha2-membership.ts +7 -5
  27. package/lib/artifacts/iso3166-1/alpha3-membership.ts +7 -5
  28. package/lib/artifacts/iso3166-1/records.ts +7 -5
  29. package/lib/bcp47/subtag-index.ts +65 -0
  30. package/lib/bcp47/tag.ts +301 -0
  31. package/lib/errors.ts +22 -9
  32. package/lib/iata/airports/records.ts +3 -4
  33. package/lib/iata/airports/validate.ts +6 -5
  34. package/lib/index.ts +18 -8
  35. package/lib/inspect.ts +5 -5
  36. package/lib/iso15924/codes.ts +169 -0
  37. package/lib/iso15924/unicode-script.ts +124 -0
  38. package/lib/iso3166/alpha2.ts +5 -5
  39. package/lib/iso3166/alpha3.ts +6 -6
  40. package/lib/iso3166/records.ts +9 -8
  41. package/lib/iso3166/relations.ts +5 -5
  42. package/lib/iso639/languages.ts +88 -0
  43. package/lib/key.ts +9 -7
  44. package/lib/normalize.ts +12 -8
  45. package/lib/overlap/country-airport.ts +14 -12
  46. package/lib/rgy1/base64.ts +3 -4
  47. package/lib/rgy1/reader.ts +8 -7
  48. package/lib/rgy1/sections.generated.ts +6 -5
  49. package/lib/rgy1/views.ts +5 -6
  50. package/lib/types.ts +66 -7
  51. package/lib/wasm.ts +11 -9
  52. package/out/artifacts/bcp47/extlang.d.ts +21 -0
  53. package/out/artifacts/bcp47/extlang.d.ts.map +1 -0
  54. package/out/artifacts/bcp47/extlang.fixture.json +260 -0
  55. package/out/artifacts/bcp47/extlang.js +17 -0
  56. package/out/artifacts/bcp47/extlang.js.map +1 -0
  57. package/out/artifacts/bcp47/grandfathered.d.ts +21 -0
  58. package/out/artifacts/bcp47/grandfathered.d.ts.map +1 -0
  59. package/out/artifacts/bcp47/grandfathered.fixture.json +28 -0
  60. package/out/artifacts/bcp47/grandfathered.js +17 -0
  61. package/out/artifacts/bcp47/grandfathered.js.map +1 -0
  62. package/out/artifacts/bcp47/language.d.ts +21 -0
  63. package/out/artifacts/bcp47/language.d.ts.map +1 -0
  64. package/out/artifacts/bcp47/language.fixture.json +8278 -0
  65. package/out/artifacts/bcp47/language.js +17 -0
  66. package/out/artifacts/bcp47/language.js.map +1 -0
  67. package/out/artifacts/bcp47/redundant.d.ts +21 -0
  68. package/out/artifacts/bcp47/redundant.d.ts.map +1 -0
  69. package/out/artifacts/bcp47/redundant.fixture.json +69 -0
  70. package/out/artifacts/bcp47/redundant.js +17 -0
  71. package/out/artifacts/bcp47/redundant.js.map +1 -0
  72. package/out/artifacts/bcp47/region.d.ts +21 -0
  73. package/out/artifacts/bcp47/region.d.ts.map +1 -0
  74. package/out/artifacts/bcp47/region.fixture.json +307 -0
  75. package/out/artifacts/bcp47/region.js +17 -0
  76. package/out/artifacts/bcp47/region.js.map +1 -0
  77. package/out/artifacts/bcp47/script.d.ts +21 -0
  78. package/out/artifacts/bcp47/script.d.ts.map +1 -0
  79. package/out/artifacts/bcp47/script.fixture.json +227 -0
  80. package/out/artifacts/bcp47/script.js +17 -0
  81. package/out/artifacts/bcp47/script.js.map +1 -0
  82. package/out/artifacts/bcp47/variant.d.ts +21 -0
  83. package/out/artifacts/bcp47/variant.d.ts.map +1 -0
  84. package/out/artifacts/bcp47/variant.fixture.json +141 -0
  85. package/out/artifacts/bcp47/variant.js +17 -0
  86. package/out/artifacts/bcp47/variant.js.map +1 -0
  87. package/out/artifacts/country-airport-collision.d.ts +0 -8
  88. package/out/artifacts/country-airport-collision.d.ts.map +1 -1
  89. package/out/artifacts/country-airport-collision.js +6 -5
  90. package/out/artifacts/country-airport-collision.js.map +1 -1
  91. package/out/artifacts/iata-airport/membership.d.ts +0 -8
  92. package/out/artifacts/iata-airport/membership.d.ts.map +1 -1
  93. package/out/artifacts/iata-airport/membership.js +6 -5
  94. package/out/artifacts/iata-airport/membership.js.map +1 -1
  95. package/out/artifacts/iata-airport/records.d.ts +0 -8
  96. package/out/artifacts/iata-airport/records.d.ts.map +1 -1
  97. package/out/artifacts/iata-airport/records.js +6 -5
  98. package/out/artifacts/iata-airport/records.js.map +1 -1
  99. package/out/artifacts/iso3166-1/alpha2-membership.d.ts +0 -8
  100. package/out/artifacts/iso3166-1/alpha2-membership.d.ts.map +1 -1
  101. package/out/artifacts/iso3166-1/alpha2-membership.js +6 -5
  102. package/out/artifacts/iso3166-1/alpha2-membership.js.map +1 -1
  103. package/out/artifacts/iso3166-1/alpha3-membership.d.ts +0 -8
  104. package/out/artifacts/iso3166-1/alpha3-membership.d.ts.map +1 -1
  105. package/out/artifacts/iso3166-1/alpha3-membership.js +6 -5
  106. package/out/artifacts/iso3166-1/alpha3-membership.js.map +1 -1
  107. package/out/artifacts/iso3166-1/records.d.ts +0 -8
  108. package/out/artifacts/iso3166-1/records.d.ts.map +1 -1
  109. package/out/artifacts/iso3166-1/records.js +6 -5
  110. package/out/artifacts/iso3166-1/records.js.map +1 -1
  111. package/out/bcp47/subtag-index.d.ts +22 -0
  112. package/out/bcp47/subtag-index.d.ts.map +1 -0
  113. package/out/bcp47/subtag-index.js +43 -0
  114. package/out/bcp47/subtag-index.js.map +1 -0
  115. package/out/bcp47/tag.d.ts +47 -0
  116. package/out/bcp47/tag.d.ts.map +1 -0
  117. package/out/bcp47/tag.js +218 -0
  118. package/out/bcp47/tag.js.map +1 -0
  119. package/out/errors.d.ts +12 -8
  120. package/out/errors.d.ts.map +1 -1
  121. package/out/errors.js +10 -8
  122. package/out/errors.js.map +1 -1
  123. package/out/iata/airports/records.d.ts +0 -7
  124. package/out/iata/airports/records.d.ts.map +1 -1
  125. package/out/iata/airports/records.js +2 -4
  126. package/out/iata/airports/records.js.map +1 -1
  127. package/out/iata/airports/validate.d.ts +0 -8
  128. package/out/iata/airports/validate.d.ts.map +1 -1
  129. package/out/iata/airports/validate.js +5 -5
  130. package/out/iata/airports/validate.js.map +1 -1
  131. package/out/index.d.ts +13 -8
  132. package/out/index.d.ts.map +1 -1
  133. package/out/index.js +6 -12
  134. package/out/index.js.map +1 -1
  135. package/out/inspect.d.ts +2 -5
  136. package/out/inspect.d.ts.map +1 -1
  137. package/out/inspect.js +4 -5
  138. package/out/inspect.js.map +1 -1
  139. package/out/iso15924/codes.d.ts +57 -0
  140. package/out/iso15924/codes.d.ts.map +1 -0
  141. package/out/iso15924/codes.js +133 -0
  142. package/out/iso15924/codes.js.map +1 -0
  143. package/out/iso15924/unicode-script.d.ts +10 -0
  144. package/out/iso15924/unicode-script.d.ts.map +1 -0
  145. package/out/iso15924/unicode-script.js +103 -0
  146. package/out/iso15924/unicode-script.js.map +1 -0
  147. package/out/iso3166/alpha2.d.ts +0 -8
  148. package/out/iso3166/alpha2.d.ts.map +1 -1
  149. package/out/iso3166/alpha2.js +4 -5
  150. package/out/iso3166/alpha2.js.map +1 -1
  151. package/out/iso3166/alpha3.d.ts +1 -9
  152. package/out/iso3166/alpha3.d.ts.map +1 -1
  153. package/out/iso3166/alpha3.js +5 -6
  154. package/out/iso3166/alpha3.js.map +1 -1
  155. package/out/iso3166/records.d.ts +0 -11
  156. package/out/iso3166/records.d.ts.map +1 -1
  157. package/out/iso3166/records.js +8 -8
  158. package/out/iso3166/records.js.map +1 -1
  159. package/out/iso3166/relations.d.ts +0 -7
  160. package/out/iso3166/relations.d.ts.map +1 -1
  161. package/out/iso3166/relations.js +4 -5
  162. package/out/iso3166/relations.js.map +1 -1
  163. package/out/iso639/languages.d.ts +40 -0
  164. package/out/iso639/languages.d.ts.map +1 -0
  165. package/out/iso639/languages.js +54 -0
  166. package/out/iso639/languages.js.map +1 -0
  167. package/out/key.d.ts +6 -7
  168. package/out/key.d.ts.map +1 -1
  169. package/out/key.js +8 -7
  170. package/out/key.js.map +1 -1
  171. package/out/normalize.d.ts +9 -8
  172. package/out/normalize.d.ts.map +1 -1
  173. package/out/normalize.js +2 -12
  174. package/out/normalize.js.map +1 -1
  175. package/out/overlap/country-airport.d.ts +2 -16
  176. package/out/overlap/country-airport.d.ts.map +1 -1
  177. package/out/overlap/country-airport.js +13 -12
  178. package/out/overlap/country-airport.js.map +1 -1
  179. package/out/rgy1/base64.d.ts +0 -4
  180. package/out/rgy1/base64.d.ts.map +1 -1
  181. package/out/rgy1/base64.js +2 -4
  182. package/out/rgy1/base64.js.map +1 -1
  183. package/out/rgy1/reader.d.ts +0 -11
  184. package/out/rgy1/reader.d.ts.map +1 -1
  185. package/out/rgy1/reader.js +7 -7
  186. package/out/rgy1/reader.js.map +1 -1
  187. package/out/rgy1/sections.generated.d.ts +3 -5
  188. package/out/rgy1/sections.generated.d.ts.map +1 -1
  189. package/out/rgy1/sections.generated.js +5 -5
  190. package/out/rgy1/sections.generated.js.map +1 -1
  191. package/out/rgy1/views.d.ts +2 -9
  192. package/out/rgy1/views.d.ts.map +1 -1
  193. package/out/rgy1/views.js +4 -6
  194. package/out/rgy1/views.js.map +1 -1
  195. package/out/sdk/fetch.d.ts +6 -6
  196. package/out/sdk/fetch.d.ts.map +1 -1
  197. package/out/sdk/fetch.js +23 -11
  198. package/out/sdk/fetch.js.map +1 -1
  199. package/out/sdk/fetch.run.d.ts +0 -12
  200. package/out/sdk/fetch.run.d.ts.map +1 -1
  201. package/out/sdk/fetch.run.js +22 -9
  202. package/out/sdk/fetch.run.js.map +1 -1
  203. package/out/sdk/sources.d.ts +7 -16
  204. package/out/sdk/sources.d.ts.map +1 -1
  205. package/out/sdk/sources.js +34 -14
  206. package/out/sdk/sources.js.map +1 -1
  207. package/out/tools/artifact-path.d.ts +0 -5
  208. package/out/tools/artifact-path.d.ts.map +1 -1
  209. package/out/tools/artifact-path.js +2 -5
  210. package/out/tools/artifact-path.js.map +1 -1
  211. package/out/tools/bench.run.d.ts +0 -17
  212. package/out/tools/bench.run.d.ts.map +1 -1
  213. package/out/tools/bench.run.js +13 -10
  214. package/out/tools/bench.run.js.map +1 -1
  215. package/out/tools/build-wasm.run.d.ts +0 -16
  216. package/out/tools/build-wasm.run.d.ts.map +1 -1
  217. package/out/tools/build-wasm.run.js +8 -10
  218. package/out/tools/build-wasm.run.js.map +1 -1
  219. package/out/tools/generate-sections.run.d.ts +0 -11
  220. package/out/tools/generate-sections.run.d.ts.map +1 -1
  221. package/out/tools/generate-sections.run.js +5 -14
  222. package/out/tools/generate-sections.run.js.map +1 -1
  223. package/out/tools/generate.run.d.ts +0 -16
  224. package/out/tools/generate.run.d.ts.map +1 -1
  225. package/out/tools/generate.run.js +61 -17
  226. package/out/tools/generate.run.js.map +1 -1
  227. package/out/tools/language-subtags.d.ts +59 -0
  228. package/out/tools/language-subtags.d.ts.map +1 -0
  229. package/out/tools/language-subtags.js +145 -0
  230. package/out/tools/language-subtags.js.map +1 -0
  231. package/out/tools/normalize.d.ts +4 -14
  232. package/out/tools/normalize.d.ts.map +1 -1
  233. package/out/tools/normalize.js +14 -14
  234. package/out/tools/normalize.js.map +1 -1
  235. package/out/tools/normalize.run.d.ts +0 -12
  236. package/out/tools/normalize.run.d.ts.map +1 -1
  237. package/out/tools/normalize.run.js +24 -7
  238. package/out/tools/normalize.run.js.map +1 -1
  239. package/out/types.d.ts +62 -7
  240. package/out/types.d.ts.map +1 -1
  241. package/out/types.js +12 -9
  242. package/out/types.js.map +1 -1
  243. package/out/wasm.d.ts +0 -13
  244. package/out/wasm.d.ts.map +1 -1
  245. package/out/wasm.js +10 -9
  246. package/out/wasm.js.map +1 -1
  247. package/package.json +12 -4
  248. package/sdk/fetch.run.ts +25 -9
  249. package/sdk/fetch.ts +32 -12
  250. package/sdk/sources.ts +36 -14
  251. package/tools/artifact-path.ts +2 -5
  252. package/tools/bench.run.ts +19 -10
  253. package/tools/build-wasm.run.ts +9 -10
  254. package/tools/generate-sections.run.ts +6 -14
  255. package/tools/generate.run.ts +68 -17
  256. package/tools/language-subtags.ts +195 -0
  257. package/tools/normalize.run.ts +28 -7
  258. package/tools/normalize.ts +16 -15
@@ -0,0 +1,218 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
+ /**
4
+ * BCP 47 language tags (RFC 5646): parsing, validation against the IANA Language
5
+ * Subtag Registry, and canonicalization.
6
+ *
7
+ * A tag is accepted when it is well-formed (section 2.1) and valid (section 2.2.9):
8
+ * every language, extlang, script, region and variant subtag is registered, an extlang's
9
+ * prefix matches the language, and no variant or extension singleton repeats.
10
+ *
11
+ * The canonical form (section 4.5) replaces a deprecated subtag or tag with its preferred value,
12
+ * replaces a language-extlang pair with the extlang's preferred value (`zh-yue` becomes `yue`),
13
+ * orders extensions by singleton, and applies the case conventions: `ja-Jpan-JP`.
14
+ * It keeps a script the language would suppress, so `ja-Jpan` stays `ja-Jpan`.
15
+ */
16
+ import { extlangSubtagRows } from "#artifacts/bcp47/extlang";
17
+ import { grandfatheredSubtagRows } from "#artifacts/bcp47/grandfathered";
18
+ import { languageSubtagRows } from "#artifacts/bcp47/language";
19
+ import { redundantSubtagRows } from "#artifacts/bcp47/redundant";
20
+ import { regionSubtagRows } from "#artifacts/bcp47/region";
21
+ import { scriptSubtagRows } from "#artifacts/bcp47/script";
22
+ import { variantSubtagRows } from "#artifacts/bcp47/variant";
23
+ import { lazySubtagIndex } from "#bcp47/subtag-index";
24
+ import { ParseFailure } from "#errors";
25
+ const languages = lazySubtagIndex(languageSubtagRows);
26
+ const extlangs = lazySubtagIndex(extlangSubtagRows);
27
+ const scripts = lazySubtagIndex(scriptSubtagRows);
28
+ const regions = lazySubtagIndex(regionSubtagRows);
29
+ const variants = lazySubtagIndex(variantSubtagRows);
30
+ const grandfatheredTags = lazySubtagIndex(grandfatheredSubtagRows);
31
+ const redundantTags = lazySubtagIndex(redundantSubtagRows);
32
+ // The subtag grammars of RFC 5646, section 2.1, over a lowercased tag.
33
+ const SUBTAG = /^[a-z0-9]{1,8}$/;
34
+ const LANGUAGE = /^(?:[a-z]{2,3}|[a-z]{5,8})$/;
35
+ const SHORT_LANGUAGE = /^[a-z]{2,3}$/;
36
+ const EXTLANG = /^[a-z]{3}$/;
37
+ const SCRIPT = /^[a-z]{4}$/;
38
+ const REGION = /^(?:[a-z]{2}|[0-9]{3})$/;
39
+ const VARIANT = /^(?:[a-z0-9]{5,8}|[0-9][a-z0-9]{3})$/;
40
+ const SINGLETON = /^[0-9a-z]$/;
41
+ const EXTENSION_BODY = /^[a-z0-9]{2,8}$/;
42
+ /**
43
+ * The grammar admits up to three extlang subtags after a two- or three-letter language.
44
+ */
45
+ const MAX_EXTLANGS = 3;
46
+ function refuse(input, reason, part) {
47
+ return part ? { ok: false, reason, input, part } : { ok: false, reason, input };
48
+ }
49
+ function titleCase(subtag) {
50
+ return subtag.charAt(0).toUpperCase() + subtag.slice(1);
51
+ }
52
+ function compose(parts) {
53
+ return [parts.language, parts.script, parts.region, ...parts.variants, ...parts.extensions, parts.privateUse]
54
+ .filter((part) => typeof part === "string" && part !== "")
55
+ .join("-");
56
+ }
57
+ /**
58
+ * Parses, validates and canonicalizes a BCP 47 tag in any case.
59
+ *
60
+ * A refusal reports `shape` for an ill-formed tag and `not-found-in-snapshot` for a well-formed
61
+ * tag with an unregistered or misplaced subtag, with the offending subtag as `part`.
62
+ */
63
+ export function parseLanguageTag(input) {
64
+ const lower = input.toLowerCase();
65
+ const grandfathered = grandfatheredTags().get(lower);
66
+ if (grandfathered) {
67
+ if (grandfathered.preferredValue)
68
+ return parseLanguageTag(grandfathered.preferredValue);
69
+ return {
70
+ ok: true,
71
+ value: {
72
+ tag: grandfathered.subtag,
73
+ language: grandfathered.subtag,
74
+ script: null,
75
+ region: null,
76
+ variants: [],
77
+ extensions: [],
78
+ privateUse: null,
79
+ },
80
+ };
81
+ }
82
+ const redundant = redundantTags().get(lower);
83
+ if (redundant?.preferredValue)
84
+ return parseLanguageTag(redundant.preferredValue);
85
+ const subtags = lower.split("-");
86
+ if (subtags.some((subtag) => !SUBTAG.test(subtag)))
87
+ return refuse(input, ParseFailure.Shape);
88
+ let position = 0;
89
+ const at = () => subtags[position];
90
+ const matches = (grammar) => grammar.test(at() ?? "");
91
+ if (at() === "x") {
92
+ if (!subtags[1])
93
+ return refuse(input, ParseFailure.Shape);
94
+ const privateUse = subtags.join("-");
95
+ return {
96
+ ok: true,
97
+ value: {
98
+ tag: privateUse,
99
+ language: "",
100
+ script: null,
101
+ region: null,
102
+ variants: [],
103
+ extensions: [],
104
+ privateUse,
105
+ },
106
+ };
107
+ }
108
+ let language = at();
109
+ if (!language || !LANGUAGE.test(language))
110
+ return refuse(input, ParseFailure.Shape);
111
+ const languageRow = languages().get(language);
112
+ if (!languageRow)
113
+ return refuse(input, ParseFailure.NotFound, language);
114
+ language = languageRow.preferredValue ?? language;
115
+ position++;
116
+ // One extlang is valid.
117
+ // The grammar admits three, so a second is well-formed and refused as invalid.
118
+ const extlangsSeen = [];
119
+ while (SHORT_LANGUAGE.test(subtags[0]) && matches(EXTLANG)) {
120
+ extlangsSeen.push(at());
121
+ position++;
122
+ }
123
+ if (extlangsSeen.length > MAX_EXTLANGS)
124
+ return refuse(input, ParseFailure.Shape);
125
+ if (extlangsSeen.length > 1)
126
+ return refuse(input, ParseFailure.NotFound, extlangsSeen[1]);
127
+ const extlang = extlangsSeen[0];
128
+ if (extlang) {
129
+ const extlangRow = extlangs().get(extlang);
130
+ if (!extlangRow || extlangRow.prefixes?.[0] !== subtags[0])
131
+ return refuse(input, ParseFailure.NotFound, extlang);
132
+ language = extlangRow.preferredValue ?? extlang;
133
+ }
134
+ let script = null;
135
+ if (matches(SCRIPT)) {
136
+ const row = scripts().get(at());
137
+ if (!row)
138
+ return refuse(input, ParseFailure.NotFound, at());
139
+ script = titleCase(row.preferredValue ?? at());
140
+ position++;
141
+ }
142
+ let region = null;
143
+ if (matches(REGION)) {
144
+ const row = regions().get(at());
145
+ if (!row)
146
+ return refuse(input, ParseFailure.NotFound, at());
147
+ region = (row.preferredValue ?? at()).toUpperCase();
148
+ position++;
149
+ }
150
+ const variantsSeen = [];
151
+ while (at()) {
152
+ const subtag = at();
153
+ if (!VARIANT.test(subtag))
154
+ break;
155
+ const row = variants().get(subtag);
156
+ if (!row)
157
+ return refuse(input, ParseFailure.NotFound, subtag);
158
+ const canonical = row.preferredValue ?? subtag;
159
+ if (variantsSeen.includes(canonical))
160
+ return refuse(input, ParseFailure.NotFound, subtag);
161
+ variantsSeen.push(canonical);
162
+ position++;
163
+ }
164
+ const extensions = [];
165
+ const singletons = new Set();
166
+ let privateUse = null;
167
+ while (at()) {
168
+ const singleton = at();
169
+ if (!SINGLETON.test(singleton))
170
+ return refuse(input, ParseFailure.Shape, singleton);
171
+ position++;
172
+ const body = [];
173
+ if (singleton === "x") {
174
+ while (at()) {
175
+ body.push(at());
176
+ position++;
177
+ }
178
+ if (!body.length)
179
+ return refuse(input, ParseFailure.Shape, singleton);
180
+ privateUse = ["x", ...body].join("-");
181
+ break;
182
+ }
183
+ while (matches(EXTENSION_BODY)) {
184
+ body.push(at());
185
+ position++;
186
+ }
187
+ if (!body.length)
188
+ return refuse(input, ParseFailure.Shape, singleton);
189
+ if (singletons.has(singleton))
190
+ return refuse(input, ParseFailure.NotFound, singleton);
191
+ singletons.add(singleton);
192
+ extensions.push([singleton, ...body].join("-"));
193
+ }
194
+ extensions.sort();
195
+ const parts = { language, script, region, variants: variantsSeen, extensions, privateUse };
196
+ return { ok: true, value: { tag: compose(parts), ...parts } };
197
+ }
198
+ /**
199
+ * Whether `input` is a valid tag already in canonical form.
200
+ */
201
+ export function isLanguageTag(input) {
202
+ const parsed = parseLanguageTag(input);
203
+ return parsed.ok && parsed.value.tag === input;
204
+ }
205
+ /**
206
+ * The script a tag's text is written in: its explicit script subtag,
207
+ * else its language's suppressed script, else `null`.
208
+ *
209
+ * `ja-Jpan` and `ja` both give `Jpan`; `zh` gives `null`, because Chinese is written
210
+ * in `Hans` or `Hant` and the registry suppresses neither.
211
+ */
212
+ export function impliedScript(tag) {
213
+ if (tag.script)
214
+ return tag.script;
215
+ const suppressed = languages().get(tag.language)?.suppressScript;
216
+ return suppressed ? suppressed : null;
217
+ }
218
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.js","sourceRoot":"","sources":["../../lib/bcp47/tag.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;A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ulary a strict parse answers with.
7
3
  *
8
- * The four reasons are distinct so a caller can tell a misspelling from an absence. `shape` is the wrong length or
9
- * alphabet. `case` is the right letters in the wrong case. `not-found-in-snapshot` is a canonical spelling the profile
10
- * holds no record for. `status-excluded` is a code the profile holds under a status the strict brand leaves out. The
11
- * messages name no record, so a membership-only import pulls in no name dictionary.
4
+ * The four reasons are distinct so a caller can tell a misspelling from an absence.
5
+ * `shape` is the wrong length or alphabet.
6
+ *
7
+ * `case` is the right letters in the wrong case.
8
+ * `not-found-in-snapshot` is a canonical spelling the profile holds no record for.
9
+ *
10
+ * `status-excluded` is a code the profile holds under a status the strict brand leaves out.
11
+ * The messages name no record, so a membership-only import pulls in no name dictionary.
12
12
  */
13
13
  /**
14
14
  * The reason a strict parse refused its input.
@@ -30,6 +30,10 @@ export type Parsed<T> = {
30
30
  ok: false;
31
31
  reason: ParseFailure;
32
32
  input: string;
33
+ /**
34
+ * The part of a compound input that was refused, such as one subtag of a BCP 47 tag.
35
+ */
36
+ part?: string;
33
37
  };
34
38
  /**
35
39
  * Reports which refusal a fixed-length grammar gives an input, or `null` when the shape passes.
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;aACxB,KAAK,EAAE,OAAO;aACd,IAAI,EAAE,MAAM;aACZ,QAAQ,EAAE,uBAAuB;aACjC,cAAc,EAAE,iBAAiB;CACxB,CAAA;AAEV,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAA;AAE3E;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnG;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAU1G"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;aACxB,KAAK,EAAE,OAAO;aACd,IAAI,EAAE,MAAM;aACZ,QAAQ,EAAE,uBAAuB;aACjC,cAAc,EAAE,iBAAiB;CACxB,CAAA;AAEV,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAA;AAE3E;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IACjB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IACA,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,YAAY,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAEJ;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAU1G"}
package/out/errors.js CHANGED
@@ -1,14 +1,16 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
1
3
  /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
4
  * The small error vocabulary a strict parse answers with.
7
5
  *
8
- * The four reasons are distinct so a caller can tell a misspelling from an absence. `shape` is the wrong length or
9
- * alphabet. `case` is the right letters in the wrong case. `not-found-in-snapshot` is a canonical spelling the profile
10
- * holds no record for. `status-excluded` is a code the profile holds under a status the strict brand leaves out. The
11
- * messages name no record, so a membership-only import pulls in no name dictionary.
6
+ * The four reasons are distinct so a caller can tell a misspelling from an absence.
7
+ * `shape` is the wrong length or alphabet.
8
+ *
9
+ * `case` is the right letters in the wrong case.
10
+ * `not-found-in-snapshot` is a canonical spelling the profile holds no record for.
11
+ *
12
+ * `status-excluded` is a code the profile holds under a status the strict brand leaves out.
13
+ * The messages name no record, so a membership-only import pulls in no name dictionary.
12
14
  */
13
15
  /**
14
16
  * The reason a strict parse refused its input.
package/out/errors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,uBAAuB;IACjC,cAAc,EAAE,iBAAiB;CACxB,CAAA;AASV;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,MAAc,EAAE,gBAAyB;IACpF,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,YAAY,CAAC,KAAK,CAAA;IAEtD,IAAI,gBAAgB,EAAE,CAAC;QACtB,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA;QAEvC,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAA;IAC1E,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAA;AAC1D,CAAC"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../lib/errors.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,uBAAuB;IACjC,cAAc,EAAE,iBAAiB;CACxB,CAAA;AAmBV;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,MAAc,EAAE,gBAAyB;IACpF,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,YAAY,CAAC,KAAK,CAAA;IAEtD,IAAI,gBAAgB,EAAE,CAAC;QACtB,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA;QAEvC,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAA;IAC1E,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAA;AAC1D,CAAC"}
@@ -1,10 +1,3 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Airport record retrieval and the located-in-country relation over the `iata-airport-records` artifact.
7
- */
8
1
  import { Artifact } from "#rgy1/reader";
9
2
  import { type AirportRecord } from "#types";
10
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../lib/iata/airports/records.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAGN,KAAK,aAAa,EAGlB,MAAM,QAAQ,CAAA;AAiEf;;GAEG;AACH,wBAAgB,e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W,GAAG,MAAM,CAE5E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAEzD"}
@@ -1,8 +1,6 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
1
3
  /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
4
  * Airport record retrieval and the located-in-country relation over the `iata-airport-records` artifact.
7
5
  */
8
6
  import { iataAirportRecordsArtifact } from "#artifacts/iata-airport/records";
@@ -1 +1 @@
1
- {"version":3,"file":"records.js","sourceRoot":"","sources":["../../../lib/iata/airports/records.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAEN,oBAAoB,IAAI,sBAAsB,GAI9C,MAAM,QAAQ,CAAA;AAEf;;;GAGG;AACH,MAAM,UAAU,GAAG,OAAO,CAAA;AAY1B,IAAI,MAAM,GAAkB,IAAI,CAAA;AAEhC;;;GAGG;AACH,MAAM,MAAM,GAAG;IACd,OAAO,EAAE,CAAC;IACV,gBAAgB,EAAE,CAAC;IACnB,aAAa,EAAE,CAAC;IAChB,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IAC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,GAAG,CAAC,CAAA;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IACjC,OAAO,iBAAiB,EAAE,CAAC,OAAO,CAAC,MAAM,CAAA;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IACnC,OAAO,iBAAiB,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAA;AAC3C,CAAC"}
@@ -1,11 +1,3 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * The strict airport-code predicate over the `iata-airport-membership` bitset. An import of it retains that
7
- * 2,197-byte bitset and the reader, and no airport record, coordinate or name.
8
- */
9
1
  import { type Parsed } from "#errors";
10
2
  import { BitsetView } from "#rgy1/views";
11
3
  import type { IATA } from "#types";
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../lib/iata/airports/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,KAAK,MAAM,EAA8B,MAAM,SAAS,CAAA;AAGjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAIlC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAI9C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,CAEtE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAQxE"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../lib/iata/airports/validate.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,MAAM,EAA8B,MAAM,SAAS,CAAA;AAGjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAIlC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAI9C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,CAEtE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAQxE"}
@@ -1,10 +1,10 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
1
3
  /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
4
+ * The strict airport-code predicate over the `iata-airport-membership` bitset.
5
5
  *
6
- * The strict airport-code predicate over the `iata-airport-membership` bitset. An import of it retains that
7
- * 2,197-byte bitset and the reader, and no airport record, coordinate or name.
6
+ * An import of it retains that 2,197-byte bitset and the reader,
7
+ * and no airport record, coordinate or name.
8
8
  */
9
9
  import { iataAirportMembershipArtifact } from "#artifacts/iata-airport/membership";
10
10
  import { ParseFailure, shapeFailure } from "#errors";
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../lib/iata/airports/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAClF,OAAO,EAAe,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,IAAI,MAAM,GAAsB,IAAI,CAAA;AAEpC;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAChC,MAA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AQ,CAAC,KAAK,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAA;IAEzE,OAAO,MAAM,CAAA;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IAC1C,OAAO,iBAAiB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC7C,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;IAE1C,IAAI,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IAErD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAA;IAErF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AAClC,CAAC"}
package/out/index.d.ts CHANGED
@@ -1,27 +1,32 @@
1
1
  /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
2
+ * `@mailwoman/registry`: standardized identifiers and their relationships,
3
+ * compiled from pinned open sources.
5
4
  *
6
- * `@mailwoman/registry`: standardized identifiers and their relationships, compiled from pinned open sources.
5
+ * The root entry re-exports the narrow modules.
6
+ * Every export is a function or a type, and no module decodes an artifact until its
7
+ * first call, so importing the root costs the modules the bundler keeps and no table.
7
8
  *
8
- * The root entry re-exports the narrow modules. Every export is a function or a type, and no module decodes an
9
- * artifact until its first call, so importing the root costs the modules the bundler keeps and no table.
10
9
  * Import a subpath such as `@mailwoman/registry/iso3166/alpha2` when a bundle must retain one table only.
11
10
  */
11
+ export type { LanguageTag } from "#bcp47/tag";
12
+ export { impliedScript, isLanguageTag, parseLanguageTag } from "#bcp47/tag";
12
13
  export type { ParseFailure, Parsed } from "#errors";
13
14
  export { getAirportByIATA, airportsInCountry, airportRecordCount, airportRecordsHeader } from "#iata/airports/records";
14
15
  export { isAirportCode, parseAirportCode } from "#iata/airports/validate";
15
16
  export type { ArtifactInspection } from "#inspect";
16
17
  export { inspectArtifact } from "#inspect";
18
+ export type { ScriptRecord } from "#iso15924/codes";
19
+ export { getScript, isScriptCode, isWrittenInScript, parseScriptCode, unicodeScriptsOf } from "#iso15924/codes";
17
20
  export { isCountryCodeAlpha2, parseCountryCodeAlpha2 } from "#iso3166/alpha2";
18
21
  export { isCountryCodeAlpha3, parseCountryCodeAlpha3 } from "#iso3166/alpha3";
19
22
  export { countryRecordCount, countryRecordsHeader, getCountryByAlpha2, getCountryByAlpha3, getCountryByNumeric, } from "#iso3166/records";
20
23
  export { alpha2ForAlpha3, alpha2ForNumeric, alpha3ForAlpha2 } from "#iso3166/relations";
24
+ export type { LanguageRecord } from "#iso639/languages";
25
+ export { getLanguage, isLanguageSubtag, parseLanguageSubtag } from "#iso639/languages";
21
26
  export type { Normalization } from "#normalize";
22
27
  export { canonicalSpelling } from "#normalize";
23
28
  export type { CodeMatch } from "#overlap/country-airport";
24
29
  export { interpretCountryOrAirportCode, isCountryAirportCollision } from "#overlap/country-airport";
25
- export type { AirportRecord, CountryRecord, IATA, ICAO, ISO } from "#types";
26
- export { AirportCountryStatus, CountryStatus } from "#types";
30
+ export type { AirportRecord, BCP47, CountryRecord, IATA, ICAO, ISO, SubtagRow } from "#types";
31
+ export { AirportCountryStatus, CountryStatus, SubtagType } from "#types";
27
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EA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E,MAAM,QAAQ,CAAA"}
package/out/index.js CHANGED
@@ -1,22 +1,16 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * `@mailwoman/registry`: standardized identifiers and their relationships, compiled from pinned open sources.
7
- *
8
- * The root entry re-exports the narrow modules. Every export is a function or a type, and no module decodes an
9
- * artifact until its first call, so importing the root costs the modules the bundler keeps and no table.
10
- * Import a subpath such as `@mailwoman/registry/iso3166/alpha2` when a bundle must retain one table only.
11
- */
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
+ export { impliedScript, isLanguageTag, parseLanguageTag } from "#bcp47/tag";
12
4
  export { getAirportByIATA, airportsInCountry, airportRecordCount, airportRecordsHeader } from "#iata/airports/records";
13
5
  export { isAirportCode, parseAirportCode } from "#iata/airports/validate";
14
6
  export { inspectArtifact } from "#inspect";
7
+ export { getScript, isScriptCode, isWrittenInScript, parseScriptCode, unicodeScriptsOf } from "#iso15924/codes";
15
8
  export { isCountryCodeAlpha2, parseCountryCodeAlpha2 } from "#iso3166/alpha2";
16
9
  export { isCountryCodeAlpha3, parseCountryCodeAlpha3 } from "#iso3166/alpha3";
17
10
  export { countryRecordCount, countryRecordsHeader, getCountryByAlpha2, getCountryByAlpha3, getCountryByNumeric, } from "#iso3166/records";
18
11
  export { alpha2ForAlpha3, alpha2ForNumeric, alpha3ForAlpha2 } from "#iso3166/relations";
12
+ export { getLanguage, isLanguageSubtag, parseLanguageSubtag } from "#iso639/languages";
19
13
  export { canonicalSpelling } from "#normalize";
20
14
  export { interpretCountryOrAirportCode, isCountryAirportCollision } from "#overlap/country-airport";
21
- export { AirportCountryStatus, CountryStatus } from "#types";
15
+ export { AirportCountryStatus, CountryStatus, SubtagType } from "#types";
22
16
  //# sourceMappingURL=index.js.map
package/out/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACtH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAEnG,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAclE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE3E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACtH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAE7E,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEvF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAEtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAEnG,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA"}
package/out/inspect.d.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Coverage and provenance inspection: what an artifact's profile holds, read from its header and directory.
2
+ * Coverage and provenance inspection: what an artifact's profile holds,
3
+ * read from its header and directory.
7
4
  */
8
5
  import { type Artifact, type ArtifactHeader } from "#rgy1/reader";
9
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../lib/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAA4B,MAAM,cAAc,CAAA;AAE3F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,EAAE,CAAA;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,MAAM,CAAA;KAAE,CAAC,CAAA;CAC5E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,GAAG,kBAAkB,CAqBhF"}
package/out/inspect.js CHANGED
@@ -1,9 +1,8 @@
1
+ // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
+ // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
1
3
  /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Coverage and provenance inspection: what an artifact's profile holds, read from its header and directory.
4
+ * Coverage and provenance inspection: what an artifact's profile holds,
5
+ * read from its header and directory.
7
6
  */
8
7
  import { Artifact as RGY1Artifact } from "#rgy1/reader";
9
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"inspect.js","sourceRoot":"","sources":["../lib/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsC,QAAQ,IAAI,YAAY,EAAE,MAAM,cAAc,CAAA;AAuB3F;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA4B;IAC3D,MAAM,QAAQ,GAAG,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAClF,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAA;IAE3B,OAAO;QACN,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS,EAAE,uBAAuB;QAClC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC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AAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC7C,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,MAAM;YACrB,GAAG,EAAE,OAAO,CAAC,GAAG;SAChB,CAAC,CAAC;KACH,CAAA;AACF,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { type Parsed } from "#errors";
2
+ import type { BCP47 } from "#types";
3
+ /**
4
+ * One script as the registry describes it.
5
+ */
6
+ export interface ScriptRecord {
7
+ code: BCP47.ScriptCode;
8
+ /**
9
+ * The registry's first description, such as `Japanese (alias for Han + Hiragana + Katakana)`.
10
+ */
11
+ name: string;
12
+ descriptions: readonly string[];
13
+ /**
14
+ * The date the registry deprecated the code, or `null`.
15
+ */
16
+ deprecated: string | null;
17
+ }
18
+ /**
19
+ * Whether `input` is a script code the registry holds, in its canonical title case.
20
+ *
21
+ * `Latn` and `Jpan` are.
22
+ * `latn`, `LATN` and `Latin` are not.
23
+ */
24
+ export declare function isScriptCode(input: string): input is BCP47.ScriptCode;
25
+ /**
26
+ * The branded script code, or the reason the input was refused.
27
+ */
28
+ export declare function parseScriptCode(input: string): Parsed<BCP47.ScriptCode>;
29
+ /**
30
+ * The record of a canonical script code, or `null`.
31
+ */
32
+ export declare function getScript(code: string): ScriptRecord | null;
33
+ /**
34
+ * The Unicode Script property values whose characters a script code covers.
35
+ *
36
+ * `Jpan` gives `Hani`, `Hira` and `Kana`, and `Latn` gives `Latn`.
37
+ * A code with no Unicode script of its own, such as `Zmth` (mathematical notation)
38
+ * or a private-use code, gives an empty list.
39
+ *
40
+ * The runtime's regular-expression engine decides which values it knows.
41
+ */
42
+ export declare function unicodeScriptsOf(code: BCP47.ScriptCode): readonly string[];
43
+ /**
44
+ * Whether every letter in `text` belongs to one of the scripts the code covers.
45
+ *
46
+ * Digits, punctuation, spaces and other non-letters are ignored, so `ニューヨーク州 10001` is written in `Jpan`.
47
+ * A text without letters returns `false`, because it shows no script at all.
48
+ *
49
+ * Common and Inherited letters, such as the prolonged sound mark `ー` in `ニューヨーク`,
50
+ * are accepted beside any script and don't count as evidence of one.
51
+ *
52
+ * Letters of an `alsoAccepted` script pass without counting, so `金龍酒家, 12 Gerrard Street`
53
+ * is written in `Latn` when `Hani` is also accepted: the Latin letters make up
54
+ * the address, and the Han name sits inside it.
55
+ */
56
+ export declare function isWrittenInScript(text: string, code: BCP47.ScriptCode, alsoAccepted?: readonly BCP47.ScriptCode[]): boolean;
57
+ //# sourceMappingURL=codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../lib/iso15924/codes.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,SAAS,CAAA;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAOnC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,KAAK,CAAC,UAAU,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,KAAK,CAAC,UAAU,CAErE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAQvE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAa3D;AAoCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,GAAG,SAAS,MAAM,EAAE,CAM1E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,KAAK,CAAC,UAAU,EACtB,YAAY,GAAE,SAAS,KAAK,CAAC,UAAU,EAAO,GAC5C,OAAO,CAoBT"}