@johnmorrisdotca/kuni 1.2.0 → 1.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.
package/dist/load.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as Subdivision } from './types-ChquRAZM.cjs';
1
+ import { S as Subdivision } from './types-KWZz5xby.cjs';
2
2
 
3
3
  /**
4
4
  * The subdivisions of one country, every level, in code order: the same list as
package/dist/load.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as Subdivision } from './types-ChquRAZM.js';
1
+ import { S as Subdivision } from './types-KWZz5xby.js';
2
2
 
3
3
  /**
4
4
  * The subdivisions of one country, every level, in code order: the same list as
@@ -1,5 +1,5 @@
1
- import { i as SubdivisionFacts } from './types-ChquRAZM.cjs';
2
- export { L as LatLon } from './types-ChquRAZM.cjs';
1
+ import { i as SubdivisionFacts } from './types-KWZz5xby.cjs';
2
+ export { L as LatLon } from './types-KWZz5xby.cjs';
3
3
 
4
4
  /**
5
5
  * The facts about one country's subdivisions, every level, in code order: one object for each subdivision, with
@@ -1,5 +1,5 @@
1
- import { i as SubdivisionFacts } from './types-ChquRAZM.js';
2
- export { L as LatLon } from './types-ChquRAZM.js';
1
+ import { i as SubdivisionFacts } from './types-KWZz5xby.js';
2
+ export { L as LatLon } from './types-KWZz5xby.js';
3
3
 
4
4
  /**
5
5
  * The facts about one country's subdivisions, every level, in code order: one object for each subdivision, with
@@ -1,5 +1,5 @@
1
- import { S as Subdivision, d as Language } from './types-ChquRAZM.cjs';
2
- export { j as SUBDIVISION_TYPES, h as SubdivisionType } from './types-ChquRAZM.cjs';
1
+ import { S as Subdivision, d as Language } from './types-KWZz5xby.cjs';
2
+ export { j as SUBDIVISION_TYPES, h as SubdivisionType } from './types-KWZz5xby.cjs';
3
3
 
4
4
  /** A level of subdivision: 1 for a country's first division, 2 and 3 for those inside one, or "all". */
5
5
  type Level = 1 | 2 | 3 | "all";
@@ -1,5 +1,5 @@
1
- import { S as Subdivision, d as Language } from './types-ChquRAZM.js';
2
- export { j as SUBDIVISION_TYPES, h as SubdivisionType } from './types-ChquRAZM.js';
1
+ import { S as Subdivision, d as Language } from './types-KWZz5xby.js';
2
+ export { j as SUBDIVISION_TYPES, h as SubdivisionType } from './types-KWZz5xby.js';
3
3
 
4
4
  /** A level of subdivision: 1 for a country's first division, 2 and 3 for those inside one, or "all". */
5
5
  type Level = 1 | 2 | 3 | "all";
@@ -87,6 +87,12 @@ interface Country {
87
87
  subdivisionType?: SubdivisionType;
88
88
  /** Other names people use for it, in either language: "Holland", "UK", 米国 */
89
89
  aliases?: string[];
90
+ /**
91
+ * The International Olympic Committee's country code, three letters and not always the alpha-3: "JPN", "GER" for
92
+ * Germany (DEU), "SUI" for Switzerland (CHE). From Wikidata (P984). Absent for the countries with no National
93
+ * Olympic Committee.
94
+ */
95
+ ioc?: string;
90
96
  }
91
97
  /** A subdivision of a country (a state, a province, a prefecture), with its ISO 3166-2 code, as the lookups hand it out (frozen). */
92
98
  interface Subdivision {
@@ -87,6 +87,12 @@ interface Country {
87
87
  subdivisionType?: SubdivisionType;
88
88
  /** Other names people use for it, in either language: "Holland", "UK", 米国 */
89
89
  aliases?: string[];
90
+ /**
91
+ * The International Olympic Committee's country code, three letters and not always the alpha-3: "JPN", "GER" for
92
+ * Germany (DEU), "SUI" for Switzerland (CHE). From Wikidata (P984). Absent for the countries with no National
93
+ * Olympic Committee.
94
+ */
95
+ ioc?: string;
90
96
  }
91
97
  /** A subdivision of a country (a state, a province, a prefecture), with its ISO 3166-2 code, as the lookups hand it out (frozen). */
92
98
  interface Subdivision {
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/withdrawn.ts
21
+ var withdrawn_exports = {};
22
+ __export(withdrawn_exports, {
23
+ WITHDRAWN_READ: () => WITHDRAWN_READ,
24
+ withdrawn: () => withdrawn,
25
+ withdrawnCountries: () => withdrawnCountries
26
+ });
27
+ module.exports = __toCommonJS(withdrawn_exports);
28
+
29
+ // src/data/withdrawn.data.ts
30
+ var WITHDRAWN_ROWS = [
31
+ { "code": "AIDJ", "alpha2": "AI", "alpha3": "AFI", "numeric": "262", "en": "French Territory of the Afars and the Issas", "ja": "フランス領アファル・イッサ", "since": "1974", "until": "1977", "successors": ["DJ"], "reusedBy": "AI" },
32
+ { "code": "ANHH", "alpha2": "AN", "alpha3": "ANT", "numeric": "530", "en": "Netherlands Antilles", "ja": "オランダ領アンティル", "since": "1974", "until": "2010", "successors": ["BQ", "CW", "SX"], "reusedBy": null },
33
+ { "code": "BQAQ", "alpha2": "BQ", "alpha3": "ATB", "numeric": null, "en": "British Antarctic Territory", "ja": "イギリス領南極地域", "since": "1974", "until": "1979", "successors": ["AQ"], "reusedBy": "BQ" },
34
+ { "code": "BUMM", "alpha2": "BU", "alpha3": "BUR", "numeric": "104", "en": "Burma", "ja": "ビルマ", "since": "1974", "until": "1989", "successors": ["MM"], "reusedBy": null },
35
+ { "code": "BYAA", "alpha2": "BY", "alpha3": "BYS", "numeric": "112", "en": "Byelorussian Soviet Socialist Republic", "ja": "ベラルーシ・ソビエト社会主義共和国", "since": "1974", "until": "1992", "successors": ["BY"], "reusedBy": "BY" },
36
+ { "code": "CSHH", "alpha2": "CS", "alpha3": "CSK", "numeric": "200", "en": "Czechoslovakia", "ja": "チェコスロバキア", "since": "1974", "until": "1993", "successors": ["CZ", "SK"], "reusedBy": null },
37
+ { "code": "CSXX", "alpha2": "CS", "alpha3": "SCG", "numeric": "891", "en": "Serbia and Montenegro", "ja": "セルビア・モンテネグロ", "since": "2003", "until": "2006", "successors": ["ME", "RS"], "reusedBy": null },
38
+ { "code": "CTKI", "alpha2": "CT", "alpha3": "CTE", "numeric": "128", "en": "Canton and Enderbury Islands", "ja": null, "since": "1974", "until": "1984", "successors": ["KI"], "reusedBy": null },
39
+ { "code": "DDDE", "alpha2": "DD", "alpha3": "DDR", "numeric": "278", "en": "East Germany", "ja": "東ドイツ", "since": "1974", "until": "1990", "successors": ["DE"], "reusedBy": null },
40
+ { "code": "DYBJ", "alpha2": "DY", "alpha3": "DHY", "numeric": "204", "en": "Republic of Dahomey", "ja": "ダホメ共和国", "since": "1974", "until": "1977", "successors": ["BJ"], "reusedBy": null },
41
+ { "code": "FQHH", "alpha2": "FQ", "alpha3": "ATF", "numeric": null, "en": "French Southern and Antarctic Lands", "ja": "フランス領南方・南極地域", "since": "1974", "until": "1979", "successors": ["AQ", "TF"], "reusedBy": null },
42
+ { "code": "FXFR", "alpha2": "FX", "alpha3": "FXX", "numeric": "249", "en": "Metropolitan France", "ja": "フランス本土", "since": "1993", "until": "1997", "successors": ["FR"], "reusedBy": null },
43
+ { "code": "GEHH", "alpha2": "GE", "alpha3": "GEL", "numeric": null, "en": "Gilbert and Ellice Islands", "ja": "ギルバート・エリス諸島", "since": "1974", "until": "1979", "successors": ["KI"], "reusedBy": "GE" },
44
+ { "code": "HVBF", "alpha2": "HV", "alpha3": "HVO", "numeric": "854", "en": "Republic of Upper Volta", "ja": "オートボルタ", "since": "1974", "until": "1984", "successors": ["BF"], "reusedBy": null },
45
+ { "code": "JTUM", "alpha2": "JT", "alpha3": "JTN", "numeric": "396", "en": "Johnston Atoll", "ja": "ジョンストン島", "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
46
+ { "code": "MIUM", "alpha2": "MI", "alpha3": "MID", "numeric": "488", "en": "Midway Atoll", "ja": "ミッドウェー島", "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
47
+ { "code": "NHVU", "alpha2": "NH", "alpha3": "NHB", "numeric": null, "en": "New Hebrides", "ja": "ニューヘブリディーズ諸島", "since": "1974", "until": "1980", "successors": ["VU"], "reusedBy": null },
48
+ { "code": "NQAQ", "alpha2": "NQ", "alpha3": "ATN", "numeric": "216", "en": "Queen Maud Land", "ja": "ドローニング・モード・ランド", "since": "1974", "until": "1983", "successors": ["AQ"], "reusedBy": null },
49
+ { "code": "NTHH", "alpha2": "NT", "alpha3": "NTZ", "numeric": "536", "en": "Saudi–Iraqi Neutral Zone", "ja": "サウジアラビア・イラク中立地帯", "since": "1974", "until": "1993", "successors": ["IQ", "SA"], "reusedBy": null },
50
+ { "code": "PCHH", "alpha2": "PC", "alpha3": "PCI", "numeric": "582", "en": "Trust Territory of the Pacific Islands", "ja": "太平洋諸島信託統治領", "since": "1974", "until": "1986", "successors": ["FM", "MH", "MP", "PW"], "reusedBy": null },
51
+ { "code": "PUUM", "alpha2": "PU", "alpha3": "PUS", "numeric": "849", "en": "United States Miscellaneous Pacific Islands", "ja": null, "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
52
+ { "code": "PZPA", "alpha2": "PZ", "alpha3": "PCZ", "numeric": null, "en": "Panama Canal Zone", "ja": "パナマ運河地帯", "since": "1974", "until": "1980", "successors": ["PA"], "reusedBy": null },
53
+ { "code": "RHZW", "alpha2": "RH", "alpha3": "RHO", "numeric": null, "en": "Southern Rhodesia", "ja": "南ローデシア", "since": "1974", "until": "1980", "successors": ["ZW"], "reusedBy": null },
54
+ { "code": "SKIN", "alpha2": "SK", "alpha3": "SKM", "numeric": null, "en": "Kingdom of Sikkim", "ja": "シッキム王国", "since": "1974", "until": "1975", "successors": ["IN"], "reusedBy": "SK" },
55
+ { "code": "SUHH", "alpha2": "SU", "alpha3": "SUN", "numeric": "810", "en": "Soviet Union", "ja": "ソビエト連邦", "since": "1974", "until": "1992", "successors": ["AM", "AZ", "EE", "GE", "KZ", "KG", "LV", "LT", "MD", "RU", "TJ", "TM", "UZ"], "reusedBy": null },
56
+ { "code": "TPTL", "alpha2": "TP", "alpha3": "TMP", "numeric": "626", "en": "East Timor", "ja": "東ティモール", "since": "1974", "until": "2002", "successors": ["TL"], "reusedBy": null },
57
+ { "code": "VDVN", "alpha2": "VD", "alpha3": "VDR", "numeric": null, "en": "North Vietnam", "ja": "北ベトナム", "since": "1974", "until": "1977", "successors": ["VN"], "reusedBy": null },
58
+ { "code": "WKUM", "alpha2": "WK", "alpha3": "WAK", "numeric": "872", "en": "Wake Island", "ja": "ウェーク島", "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
59
+ { "code": "YDYE", "alpha2": "YD", "alpha3": "YMD", "numeric": "720", "en": "South Yemen", "ja": "南イエメン", "since": "1974", "until": "1990", "successors": ["YE"], "reusedBy": null },
60
+ { "code": "YUCS", "alpha2": "YU", "alpha3": "YUG", "numeric": "891", "en": "Yugoslavia", "ja": "ユーゴスラビア", "since": "1974", "until": "2003", "successors": ["CS"], "reusedBy": null },
61
+ { "code": "ZRCD", "alpha2": "ZR", "alpha3": "ZAR", "numeric": "180", "en": "Zaire", "ja": "ザイール", "since": "1974", "until": "1997", "successors": ["CD"], "reusedBy": null }
62
+ ];
63
+ var WITHDRAWN_READ = "2026-10-10";
64
+
65
+ // src/withdrawn.ts
66
+ var expand = (row) => {
67
+ const country = {
68
+ code: row.code,
69
+ alpha2: row.alpha2,
70
+ name: Object.freeze({ en: row.en, ja: row.ja }),
71
+ since: row.since,
72
+ until: row.until,
73
+ successors: Object.freeze([...row.successors])
74
+ };
75
+ if (row.alpha3 !== null) country.alpha3 = row.alpha3;
76
+ if (row.numeric !== null) country.numeric = row.numeric;
77
+ if (row.reusedBy !== null) country.reusedBy = row.reusedBy;
78
+ return Object.freeze(country);
79
+ };
80
+ var table = null;
81
+ var getTable = () => {
82
+ if (table === null) table = Object.freeze(WITHDRAWN_ROWS.map(expand));
83
+ return table;
84
+ };
85
+ var withdrawnCountries = () => getTable();
86
+ var withdrawn = (code) => {
87
+ if (typeof code !== "string") return [];
88
+ const wanted = code.trim().toUpperCase();
89
+ if (wanted === "") return [];
90
+ return getTable().filter((one) => one.code === wanted || one.alpha2 === wanted || one.alpha3 === wanted || one.numeric === wanted).sort((a, b) => a.until < b.until ? 1 : a.until > b.until ? -1 : 0);
91
+ };
92
+ // Annotate the CommonJS export names for ESM import in node:
93
+ 0 && (module.exports = {
94
+ WITHDRAWN_READ,
95
+ withdrawn,
96
+ withdrawnCountries
97
+ });
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The day the Wikidata snapshot of the withdrawn codes was read.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import { WITHDRAWN_READ } from "@johnmorrisdotca/kuni/withdrawn";
7
+ *
8
+ * WITHDRAWN_READ; // "2026-10-10"
9
+ * ```
10
+ */
11
+ declare const WITHDRAWN_READ = "2026-10-10";
12
+
13
+ /** A country that was withdrawn from ISO 3166-1, as ISO 3166-3 lists it (frozen). */
14
+ interface WithdrawnCountry {
15
+ /** The four-letter ISO 3166-3 code: "SUHH" for the Soviet Union. Its first two letters are the alpha-2 code. */
16
+ code: string;
17
+ /** The ISO 3166-1 alpha-2 code it held: "SU". */
18
+ alpha2: string;
19
+ /** The alpha-3 code it held, "SUN", as ISO 3166-3 lists it. */
20
+ alpha3?: string;
21
+ /** The numeric code it held, "810"; absent where ISO 3166-3 lists none (Gilbert and Ellice Islands, New Hebrides). */
22
+ numeric?: string;
23
+ /** Its name in English and Japanese; `ja` is `null` where Wikidata has none, never an English name copied in. */
24
+ name: {
25
+ en: string;
26
+ ja: string | null;
27
+ };
28
+ /** The year its code came into force, "1974" (a full day, "1974-12-15", where Wikidata gives one). */
29
+ since: string;
30
+ /** The year its code was withdrawn, "1992", or a full day, "1990-08-14". */
31
+ until: string;
32
+ /**
33
+ * The new codes ISO 3166-3 lists for it, in ISO's order: ["AM", "AZ", ...] for the Soviet Union. A successor may itself
34
+ * be withdrawn: Yugoslavia's is "CS", which `withdrawn("CS")` resolves to Serbia and Montenegro (CSXX) first and
35
+ * Czechoslovakia (CSHH) after it.
36
+ */
37
+ successors: readonly string[];
38
+ /**
39
+ * Set when the alpha-2 code was later given to a current country, so that the code means two things in time: "BY"
40
+ * was the Byelorussian SSR and is Belarus. The value is that country's alpha-2 code. Absent for codes nobody has
41
+ * been given again (SU, YU, CS, DD, ZR, TP, AN, BU).
42
+ */
43
+ reusedBy?: string;
44
+ }
45
+ /**
46
+ * Every withdrawn country of ISO 3166-3, in order of its four-letter code. Never part of `countries()`, so a picker
47
+ * does not show them unless it asks.
48
+ *
49
+ * @returns The 31 records, the list and its objects frozen and shared.
50
+ * @example
51
+ * ```ts
52
+ * import { withdrawnCountries } from "@johnmorrisdotca/kuni/withdrawn";
53
+ *
54
+ * withdrawnCountries().length; // 31
55
+ * withdrawnCountries().map((one) => one.alpha2).includes("SU"); // true
56
+ * ```
57
+ */
58
+ declare const withdrawnCountries: () => readonly WithdrawnCountry[];
59
+ /**
60
+ * The withdrawn countries that held a code: the four-letter ISO 3166-3 code ("SUHH"), an alpha-2 ("SU"), an alpha-3
61
+ * ("SUN") or a numeric code ("810"), in either case. A code can name more than one: "CS" was Czechoslovakia (CSHH)
62
+ * and then Serbia and Montenegro (CSXX), later first; and "BY" is a withdrawn country as well as a current one, which
63
+ * `country("BY")` answers on its own.
64
+ *
65
+ * @param code - Any code a withdrawn country held.
66
+ * @returns The matching records, the one that was withdrawn last first; an empty list for anything else, and for
67
+ * the code of a current country that was never withdrawn.
68
+ * @example
69
+ * ```ts
70
+ * import { withdrawn } from "@johnmorrisdotca/kuni/withdrawn";
71
+ *
72
+ * withdrawn("su")[0].name.en; // "Soviet Union"
73
+ * withdrawn("SU")[0].until; // "1992"
74
+ * withdrawn("YUCS")[0].successors; // ["CS"]: itself withdrawn, and resolved by withdrawn("CS")
75
+ * withdrawn("CS").map((one) => one.code); // ["CSXX", "CSHH"]
76
+ * withdrawn("JP"); // []
77
+ * ```
78
+ */
79
+ declare const withdrawn: (code: string) => readonly WithdrawnCountry[];
80
+
81
+ export { WITHDRAWN_READ, type WithdrawnCountry, withdrawn, withdrawnCountries };
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The day the Wikidata snapshot of the withdrawn codes was read.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import { WITHDRAWN_READ } from "@johnmorrisdotca/kuni/withdrawn";
7
+ *
8
+ * WITHDRAWN_READ; // "2026-10-10"
9
+ * ```
10
+ */
11
+ declare const WITHDRAWN_READ = "2026-10-10";
12
+
13
+ /** A country that was withdrawn from ISO 3166-1, as ISO 3166-3 lists it (frozen). */
14
+ interface WithdrawnCountry {
15
+ /** The four-letter ISO 3166-3 code: "SUHH" for the Soviet Union. Its first two letters are the alpha-2 code. */
16
+ code: string;
17
+ /** The ISO 3166-1 alpha-2 code it held: "SU". */
18
+ alpha2: string;
19
+ /** The alpha-3 code it held, "SUN", as ISO 3166-3 lists it. */
20
+ alpha3?: string;
21
+ /** The numeric code it held, "810"; absent where ISO 3166-3 lists none (Gilbert and Ellice Islands, New Hebrides). */
22
+ numeric?: string;
23
+ /** Its name in English and Japanese; `ja` is `null` where Wikidata has none, never an English name copied in. */
24
+ name: {
25
+ en: string;
26
+ ja: string | null;
27
+ };
28
+ /** The year its code came into force, "1974" (a full day, "1974-12-15", where Wikidata gives one). */
29
+ since: string;
30
+ /** The year its code was withdrawn, "1992", or a full day, "1990-08-14". */
31
+ until: string;
32
+ /**
33
+ * The new codes ISO 3166-3 lists for it, in ISO's order: ["AM", "AZ", ...] for the Soviet Union. A successor may itself
34
+ * be withdrawn: Yugoslavia's is "CS", which `withdrawn("CS")` resolves to Serbia and Montenegro (CSXX) first and
35
+ * Czechoslovakia (CSHH) after it.
36
+ */
37
+ successors: readonly string[];
38
+ /**
39
+ * Set when the alpha-2 code was later given to a current country, so that the code means two things in time: "BY"
40
+ * was the Byelorussian SSR and is Belarus. The value is that country's alpha-2 code. Absent for codes nobody has
41
+ * been given again (SU, YU, CS, DD, ZR, TP, AN, BU).
42
+ */
43
+ reusedBy?: string;
44
+ }
45
+ /**
46
+ * Every withdrawn country of ISO 3166-3, in order of its four-letter code. Never part of `countries()`, so a picker
47
+ * does not show them unless it asks.
48
+ *
49
+ * @returns The 31 records, the list and its objects frozen and shared.
50
+ * @example
51
+ * ```ts
52
+ * import { withdrawnCountries } from "@johnmorrisdotca/kuni/withdrawn";
53
+ *
54
+ * withdrawnCountries().length; // 31
55
+ * withdrawnCountries().map((one) => one.alpha2).includes("SU"); // true
56
+ * ```
57
+ */
58
+ declare const withdrawnCountries: () => readonly WithdrawnCountry[];
59
+ /**
60
+ * The withdrawn countries that held a code: the four-letter ISO 3166-3 code ("SUHH"), an alpha-2 ("SU"), an alpha-3
61
+ * ("SUN") or a numeric code ("810"), in either case. A code can name more than one: "CS" was Czechoslovakia (CSHH)
62
+ * and then Serbia and Montenegro (CSXX), later first; and "BY" is a withdrawn country as well as a current one, which
63
+ * `country("BY")` answers on its own.
64
+ *
65
+ * @param code - Any code a withdrawn country held.
66
+ * @returns The matching records, the one that was withdrawn last first; an empty list for anything else, and for
67
+ * the code of a current country that was never withdrawn.
68
+ * @example
69
+ * ```ts
70
+ * import { withdrawn } from "@johnmorrisdotca/kuni/withdrawn";
71
+ *
72
+ * withdrawn("su")[0].name.en; // "Soviet Union"
73
+ * withdrawn("SU")[0].until; // "1992"
74
+ * withdrawn("YUCS")[0].successors; // ["CS"]: itself withdrawn, and resolved by withdrawn("CS")
75
+ * withdrawn("CS").map((one) => one.code); // ["CSXX", "CSHH"]
76
+ * withdrawn("JP"); // []
77
+ * ```
78
+ */
79
+ declare const withdrawn: (code: string) => readonly WithdrawnCountry[];
80
+
81
+ export { WITHDRAWN_READ, type WithdrawnCountry, withdrawn, withdrawnCountries };
@@ -0,0 +1,68 @@
1
+ // src/data/withdrawn.data.ts
2
+ var WITHDRAWN_ROWS = [
3
+ { "code": "AIDJ", "alpha2": "AI", "alpha3": "AFI", "numeric": "262", "en": "French Territory of the Afars and the Issas", "ja": "フランス領アファル・イッサ", "since": "1974", "until": "1977", "successors": ["DJ"], "reusedBy": "AI" },
4
+ { "code": "ANHH", "alpha2": "AN", "alpha3": "ANT", "numeric": "530", "en": "Netherlands Antilles", "ja": "オランダ領アンティル", "since": "1974", "until": "2010", "successors": ["BQ", "CW", "SX"], "reusedBy": null },
5
+ { "code": "BQAQ", "alpha2": "BQ", "alpha3": "ATB", "numeric": null, "en": "British Antarctic Territory", "ja": "イギリス領南極地域", "since": "1974", "until": "1979", "successors": ["AQ"], "reusedBy": "BQ" },
6
+ { "code": "BUMM", "alpha2": "BU", "alpha3": "BUR", "numeric": "104", "en": "Burma", "ja": "ビルマ", "since": "1974", "until": "1989", "successors": ["MM"], "reusedBy": null },
7
+ { "code": "BYAA", "alpha2": "BY", "alpha3": "BYS", "numeric": "112", "en": "Byelorussian Soviet Socialist Republic", "ja": "ベラルーシ・ソビエト社会主義共和国", "since": "1974", "until": "1992", "successors": ["BY"], "reusedBy": "BY" },
8
+ { "code": "CSHH", "alpha2": "CS", "alpha3": "CSK", "numeric": "200", "en": "Czechoslovakia", "ja": "チェコスロバキア", "since": "1974", "until": "1993", "successors": ["CZ", "SK"], "reusedBy": null },
9
+ { "code": "CSXX", "alpha2": "CS", "alpha3": "SCG", "numeric": "891", "en": "Serbia and Montenegro", "ja": "セルビア・モンテネグロ", "since": "2003", "until": "2006", "successors": ["ME", "RS"], "reusedBy": null },
10
+ { "code": "CTKI", "alpha2": "CT", "alpha3": "CTE", "numeric": "128", "en": "Canton and Enderbury Islands", "ja": null, "since": "1974", "until": "1984", "successors": ["KI"], "reusedBy": null },
11
+ { "code": "DDDE", "alpha2": "DD", "alpha3": "DDR", "numeric": "278", "en": "East Germany", "ja": "東ドイツ", "since": "1974", "until": "1990", "successors": ["DE"], "reusedBy": null },
12
+ { "code": "DYBJ", "alpha2": "DY", "alpha3": "DHY", "numeric": "204", "en": "Republic of Dahomey", "ja": "ダホメ共和国", "since": "1974", "until": "1977", "successors": ["BJ"], "reusedBy": null },
13
+ { "code": "FQHH", "alpha2": "FQ", "alpha3": "ATF", "numeric": null, "en": "French Southern and Antarctic Lands", "ja": "フランス領南方・南極地域", "since": "1974", "until": "1979", "successors": ["AQ", "TF"], "reusedBy": null },
14
+ { "code": "FXFR", "alpha2": "FX", "alpha3": "FXX", "numeric": "249", "en": "Metropolitan France", "ja": "フランス本土", "since": "1993", "until": "1997", "successors": ["FR"], "reusedBy": null },
15
+ { "code": "GEHH", "alpha2": "GE", "alpha3": "GEL", "numeric": null, "en": "Gilbert and Ellice Islands", "ja": "ギルバート・エリス諸島", "since": "1974", "until": "1979", "successors": ["KI"], "reusedBy": "GE" },
16
+ { "code": "HVBF", "alpha2": "HV", "alpha3": "HVO", "numeric": "854", "en": "Republic of Upper Volta", "ja": "オートボルタ", "since": "1974", "until": "1984", "successors": ["BF"], "reusedBy": null },
17
+ { "code": "JTUM", "alpha2": "JT", "alpha3": "JTN", "numeric": "396", "en": "Johnston Atoll", "ja": "ジョンストン島", "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
18
+ { "code": "MIUM", "alpha2": "MI", "alpha3": "MID", "numeric": "488", "en": "Midway Atoll", "ja": "ミッドウェー島", "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
19
+ { "code": "NHVU", "alpha2": "NH", "alpha3": "NHB", "numeric": null, "en": "New Hebrides", "ja": "ニューヘブリディーズ諸島", "since": "1974", "until": "1980", "successors": ["VU"], "reusedBy": null },
20
+ { "code": "NQAQ", "alpha2": "NQ", "alpha3": "ATN", "numeric": "216", "en": "Queen Maud Land", "ja": "ドローニング・モード・ランド", "since": "1974", "until": "1983", "successors": ["AQ"], "reusedBy": null },
21
+ { "code": "NTHH", "alpha2": "NT", "alpha3": "NTZ", "numeric": "536", "en": "Saudi–Iraqi Neutral Zone", "ja": "サウジアラビア・イラク中立地帯", "since": "1974", "until": "1993", "successors": ["IQ", "SA"], "reusedBy": null },
22
+ { "code": "PCHH", "alpha2": "PC", "alpha3": "PCI", "numeric": "582", "en": "Trust Territory of the Pacific Islands", "ja": "太平洋諸島信託統治領", "since": "1974", "until": "1986", "successors": ["FM", "MH", "MP", "PW"], "reusedBy": null },
23
+ { "code": "PUUM", "alpha2": "PU", "alpha3": "PUS", "numeric": "849", "en": "United States Miscellaneous Pacific Islands", "ja": null, "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
24
+ { "code": "PZPA", "alpha2": "PZ", "alpha3": "PCZ", "numeric": null, "en": "Panama Canal Zone", "ja": "パナマ運河地帯", "since": "1974", "until": "1980", "successors": ["PA"], "reusedBy": null },
25
+ { "code": "RHZW", "alpha2": "RH", "alpha3": "RHO", "numeric": null, "en": "Southern Rhodesia", "ja": "南ローデシア", "since": "1974", "until": "1980", "successors": ["ZW"], "reusedBy": null },
26
+ { "code": "SKIN", "alpha2": "SK", "alpha3": "SKM", "numeric": null, "en": "Kingdom of Sikkim", "ja": "シッキム王国", "since": "1974", "until": "1975", "successors": ["IN"], "reusedBy": "SK" },
27
+ { "code": "SUHH", "alpha2": "SU", "alpha3": "SUN", "numeric": "810", "en": "Soviet Union", "ja": "ソビエト連邦", "since": "1974", "until": "1992", "successors": ["AM", "AZ", "EE", "GE", "KZ", "KG", "LV", "LT", "MD", "RU", "TJ", "TM", "UZ"], "reusedBy": null },
28
+ { "code": "TPTL", "alpha2": "TP", "alpha3": "TMP", "numeric": "626", "en": "East Timor", "ja": "東ティモール", "since": "1974", "until": "2002", "successors": ["TL"], "reusedBy": null },
29
+ { "code": "VDVN", "alpha2": "VD", "alpha3": "VDR", "numeric": null, "en": "North Vietnam", "ja": "北ベトナム", "since": "1974", "until": "1977", "successors": ["VN"], "reusedBy": null },
30
+ { "code": "WKUM", "alpha2": "WK", "alpha3": "WAK", "numeric": "872", "en": "Wake Island", "ja": "ウェーク島", "since": "1974", "until": "1986", "successors": ["UM"], "reusedBy": null },
31
+ { "code": "YDYE", "alpha2": "YD", "alpha3": "YMD", "numeric": "720", "en": "South Yemen", "ja": "南イエメン", "since": "1974", "until": "1990", "successors": ["YE"], "reusedBy": null },
32
+ { "code": "YUCS", "alpha2": "YU", "alpha3": "YUG", "numeric": "891", "en": "Yugoslavia", "ja": "ユーゴスラビア", "since": "1974", "until": "2003", "successors": ["CS"], "reusedBy": null },
33
+ { "code": "ZRCD", "alpha2": "ZR", "alpha3": "ZAR", "numeric": "180", "en": "Zaire", "ja": "ザイール", "since": "1974", "until": "1997", "successors": ["CD"], "reusedBy": null }
34
+ ];
35
+ var WITHDRAWN_READ = "2026-10-10";
36
+
37
+ // src/withdrawn.ts
38
+ var expand = (row) => {
39
+ const country = {
40
+ code: row.code,
41
+ alpha2: row.alpha2,
42
+ name: Object.freeze({ en: row.en, ja: row.ja }),
43
+ since: row.since,
44
+ until: row.until,
45
+ successors: Object.freeze([...row.successors])
46
+ };
47
+ if (row.alpha3 !== null) country.alpha3 = row.alpha3;
48
+ if (row.numeric !== null) country.numeric = row.numeric;
49
+ if (row.reusedBy !== null) country.reusedBy = row.reusedBy;
50
+ return Object.freeze(country);
51
+ };
52
+ var table = null;
53
+ var getTable = () => {
54
+ if (table === null) table = Object.freeze(WITHDRAWN_ROWS.map(expand));
55
+ return table;
56
+ };
57
+ var withdrawnCountries = () => getTable();
58
+ var withdrawn = (code) => {
59
+ if (typeof code !== "string") return [];
60
+ const wanted = code.trim().toUpperCase();
61
+ if (wanted === "") return [];
62
+ return getTable().filter((one) => one.code === wanted || one.alpha2 === wanted || one.alpha3 === wanted || one.numeric === wanted).sort((a, b) => a.until < b.until ? 1 : a.until > b.until ? -1 : 0);
63
+ };
64
+ export {
65
+ WITHDRAWN_READ,
66
+ withdrawn,
67
+ withdrawnCountries
68
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/kuni",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Kuni 国, every country and its subdivisions (states, provinces, prefectures, regions) with ISO 3166 codes and names in English and Japanese, from Unicode CLDR and Wikidata. Typed lookups by code or by name. Zero dependencies.",
5
5
  "keywords": [
6
6
  "countries",
@@ -131,6 +131,16 @@
131
131
  "default": "./dist/groupings.cjs"
132
132
  }
133
133
  },
134
+ "./withdrawn": {
135
+ "import": {
136
+ "types": "./dist/withdrawn.d.ts",
137
+ "default": "./dist/withdrawn.js"
138
+ },
139
+ "require": {
140
+ "types": "./dist/withdrawn.d.cts",
141
+ "default": "./dist/withdrawn.cjs"
142
+ }
143
+ },
134
144
  "./package.json": "./package.json"
135
145
  },
136
146
  "files": [
@@ -156,6 +166,7 @@
156
166
  "data:fetch": "node scripts/fetch-sources.ts",
157
167
  "data:wikidata": "node scripts/fetch-wikidata.ts",
158
168
  "data:facts": "node scripts/fetch-wikidata-facts.ts",
169
+ "data:codes": "node scripts/fetch-wikidata-codes.ts",
159
170
  "site": "pnpm build && node scripts/site.mjs",
160
171
  "test:demo": "pnpm site && playwright test",
161
172
  "screenshots:readme": "pnpm site && node scripts/readme-pictures.mjs",