@stackone/utils 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/types/countries/countriesGetters.d.ts +22 -0
- package/dist/types/countries/countriesMap.d.ts +42 -0
- package/dist/types/countries/iso31661Countries.d.ts +254 -0
- package/dist/types/countries/iso31662SubDivisions.d.ts +3828 -0
- package/dist/types/countries/subDivisionsMap.d.ts +19 -0
- package/dist/types/countries/types.d.ts +20 -0
- package/dist/types/dates.d.ts +16 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ISO31662SubDivisionCodeNamePairs } from './types';
|
|
2
|
+
export declare const getCountryAlpha2CodeByAlpha2Code: (alpha2Code: string) => string | undefined;
|
|
3
|
+
export declare const getCountryAlpha3CodeByAlpha3Code: (alpha3Code: string) => string | undefined;
|
|
4
|
+
export declare const getCountryCodeByCountryCode: (countryCode: string) => string | undefined;
|
|
5
|
+
export declare const getCountryNameByCountryName: (countryName: string) => string | undefined;
|
|
6
|
+
export declare const getCountryNameByAlpha3Code: (alpha3Code: string) => string | undefined;
|
|
7
|
+
export declare const getCountryNameByAlpha2Code: (alpha2Code: string) => string | undefined;
|
|
8
|
+
export declare const getCountryNameByCountryCode: (countryCode: string) => string | undefined;
|
|
9
|
+
export declare const getCountryAlpha3CodeByAlpha2Code: (alpha2Code: string) => string | undefined;
|
|
10
|
+
export declare const getCountryAlpha3CodeByCountryName: (countryName: string) => string | undefined;
|
|
11
|
+
export declare const getCountryAlpha3CodeByCountryCode: (countryCode: string) => string | undefined;
|
|
12
|
+
export declare const getCountryAlpha2CodeByAlpha3Code: (alpha3Code: string) => string | undefined;
|
|
13
|
+
export declare const getCountryAlpha2CodeByCountryName: (countryName: string) => string | undefined;
|
|
14
|
+
export declare const getCountryAlpha2CodeByCountryCode: (countryCode: string) => string | undefined;
|
|
15
|
+
export declare const getCountryCodeByAlpha2Code: (alpha2Code: string) => string | undefined;
|
|
16
|
+
export declare const getCountryCodeByAlpha3Code: (alpha3Code: string) => string | undefined;
|
|
17
|
+
export declare const getCountryCodeByCountryName: (countryName: string) => string | undefined;
|
|
18
|
+
export declare const getCountrySubDivisionsByAlpha2Code: (alpha2Code: string) => ISO31662SubDivisionCodeNamePairs | undefined;
|
|
19
|
+
export declare const getCountrySubDivisionByAlpha2CodeAndName: (alpha2Code: string, subDivisionName: string) => string | undefined;
|
|
20
|
+
export declare const getCountrySubDivisionNameBySubDivisionCode: (subDivisionCode: string) => string | undefined;
|
|
21
|
+
export declare const getCountrySubDivisionCodeBySubDivisionName: (subDivisionName: string) => string | undefined;
|
|
22
|
+
export declare const getCountryAlpha2CodeByCitizenship: (citizenship: string) => string | undefined;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ISO31661CountryObject } from './types';
|
|
2
|
+
export interface ICountriesMaps {
|
|
3
|
+
alphaTwoToAlphaTwo: Map<string, string>;
|
|
4
|
+
alphaTwoToAlphaThree: Map<string, string>;
|
|
5
|
+
alphaTwoToCountryName: Map<string, string>;
|
|
6
|
+
alphaTwoToCountryCode: Map<string, string>;
|
|
7
|
+
alphaThreeToAlphaThree: Map<string, string>;
|
|
8
|
+
alphaThreeToAlphaTwo: Map<string, string>;
|
|
9
|
+
alphaThreeToCountryName: Map<string, string>;
|
|
10
|
+
alphaThreeToCountryCode: Map<string, string>;
|
|
11
|
+
countryCodeToCountryCode: Map<string, string>;
|
|
12
|
+
countryCodeToAlphaThree: Map<string, string>;
|
|
13
|
+
countryCodeToCountryName: Map<string, string>;
|
|
14
|
+
countryCodeToAlphaTwo: Map<string, string>;
|
|
15
|
+
countryNameToCountryName: Map<string, string>;
|
|
16
|
+
countryNameToAlphaThree: Map<string, string>;
|
|
17
|
+
countryNameToAlphaTwo: Map<string, string>;
|
|
18
|
+
countryNameToCountryCode: Map<string, string>;
|
|
19
|
+
citizenshipToAlphaTwo: Map<string, string>;
|
|
20
|
+
}
|
|
21
|
+
export declare class CountriesMaps {
|
|
22
|
+
private iso31661Countries;
|
|
23
|
+
alphaTwoToAlphaTwo: Map<string, string>;
|
|
24
|
+
alphaTwoToAlphaThree: Map<string, string>;
|
|
25
|
+
alphaTwoToCountryName: Map<string, string>;
|
|
26
|
+
alphaTwoToCountryCode: Map<string, string>;
|
|
27
|
+
alphaThreeToAlphaThree: Map<string, string>;
|
|
28
|
+
alphaThreeToAlphaTwo: Map<string, string>;
|
|
29
|
+
alphaThreeToCountryName: Map<string, string>;
|
|
30
|
+
alphaThreeToCountryCode: Map<string, string>;
|
|
31
|
+
countryCodeToCountryCode: Map<string, string>;
|
|
32
|
+
countryCodeToAlphaThree: Map<string, string>;
|
|
33
|
+
countryCodeToCountryName: Map<string, string>;
|
|
34
|
+
countryCodeToAlphaTwo: Map<string, string>;
|
|
35
|
+
citizenshipToAlphaTwo: Map<string, string>;
|
|
36
|
+
countryNameToCountryName: Map<string, string>;
|
|
37
|
+
countryNameToAlphaThree: Map<string, string>;
|
|
38
|
+
countryNameToAlphaTwo: Map<string, string>;
|
|
39
|
+
countryNameToCountryCode: Map<string, string>;
|
|
40
|
+
constructor(iso31661Countries?: Record<string, ISO31661CountryObject>);
|
|
41
|
+
private createCountriesMaps;
|
|
42
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { ISO31661CountryObject } from './types';
|
|
2
|
+
export declare const ISO31661Countries: Record<string, ISO31661CountryObject>;
|
|
3
|
+
export declare const ISO31661Alpha2CodeEnum: {
|
|
4
|
+
readonly AF: "AF";
|
|
5
|
+
readonly AL: "AL";
|
|
6
|
+
readonly DZ: "DZ";
|
|
7
|
+
readonly AS: "AS";
|
|
8
|
+
readonly AD: "AD";
|
|
9
|
+
readonly AO: "AO";
|
|
10
|
+
readonly AI: "AI";
|
|
11
|
+
readonly AQ: "AQ";
|
|
12
|
+
readonly AG: "AG";
|
|
13
|
+
readonly AR: "AR";
|
|
14
|
+
readonly AM: "AM";
|
|
15
|
+
readonly AW: "AW";
|
|
16
|
+
readonly AU: "AU";
|
|
17
|
+
readonly AT: "AT";
|
|
18
|
+
readonly AZ: "AZ";
|
|
19
|
+
readonly BS: "BS";
|
|
20
|
+
readonly BH: "BH";
|
|
21
|
+
readonly BD: "BD";
|
|
22
|
+
readonly BB: "BB";
|
|
23
|
+
readonly BY: "BY";
|
|
24
|
+
readonly BE: "BE";
|
|
25
|
+
readonly BZ: "BZ";
|
|
26
|
+
readonly BJ: "BJ";
|
|
27
|
+
readonly BM: "BM";
|
|
28
|
+
readonly BT: "BT";
|
|
29
|
+
readonly BO: "BO";
|
|
30
|
+
readonly BQ: "BQ";
|
|
31
|
+
readonly BA: "BA";
|
|
32
|
+
readonly BW: "BW";
|
|
33
|
+
readonly BV: "BV";
|
|
34
|
+
readonly BR: "BR";
|
|
35
|
+
readonly IO: "IO";
|
|
36
|
+
readonly BN: "BN";
|
|
37
|
+
readonly BG: "BG";
|
|
38
|
+
readonly BF: "BF";
|
|
39
|
+
readonly BI: "BI";
|
|
40
|
+
readonly KH: "KH";
|
|
41
|
+
readonly CM: "CM";
|
|
42
|
+
readonly CA: "CA";
|
|
43
|
+
readonly CV: "CV";
|
|
44
|
+
readonly KY: "KY";
|
|
45
|
+
readonly CF: "CF";
|
|
46
|
+
readonly TD: "TD";
|
|
47
|
+
readonly CL: "CL";
|
|
48
|
+
readonly CN: "CN";
|
|
49
|
+
readonly CX: "CX";
|
|
50
|
+
readonly CC: "CC";
|
|
51
|
+
readonly CO: "CO";
|
|
52
|
+
readonly KM: "KM";
|
|
53
|
+
readonly CG: "CG";
|
|
54
|
+
readonly CD: "CD";
|
|
55
|
+
readonly CK: "CK";
|
|
56
|
+
readonly CR: "CR";
|
|
57
|
+
readonly HR: "HR";
|
|
58
|
+
readonly CU: "CU";
|
|
59
|
+
readonly CW: "CW";
|
|
60
|
+
readonly CY: "CY";
|
|
61
|
+
readonly CZ: "CZ";
|
|
62
|
+
readonly CI: "CI";
|
|
63
|
+
readonly DK: "DK";
|
|
64
|
+
readonly DJ: "DJ";
|
|
65
|
+
readonly DM: "DM";
|
|
66
|
+
readonly DO: "DO";
|
|
67
|
+
readonly EC: "EC";
|
|
68
|
+
readonly EG: "EG";
|
|
69
|
+
readonly SV: "SV";
|
|
70
|
+
readonly GQ: "GQ";
|
|
71
|
+
readonly ER: "ER";
|
|
72
|
+
readonly EE: "EE";
|
|
73
|
+
readonly ET: "ET";
|
|
74
|
+
readonly FK: "FK";
|
|
75
|
+
readonly FO: "FO";
|
|
76
|
+
readonly FJ: "FJ";
|
|
77
|
+
readonly FI: "FI";
|
|
78
|
+
readonly FR: "FR";
|
|
79
|
+
readonly GF: "GF";
|
|
80
|
+
readonly PF: "PF";
|
|
81
|
+
readonly TF: "TF";
|
|
82
|
+
readonly GA: "GA";
|
|
83
|
+
readonly GM: "GM";
|
|
84
|
+
readonly GE: "GE";
|
|
85
|
+
readonly DE: "DE";
|
|
86
|
+
readonly GH: "GH";
|
|
87
|
+
readonly GI: "GI";
|
|
88
|
+
readonly GR: "GR";
|
|
89
|
+
readonly GL: "GL";
|
|
90
|
+
readonly GD: "GD";
|
|
91
|
+
readonly GP: "GP";
|
|
92
|
+
readonly GU: "GU";
|
|
93
|
+
readonly GT: "GT";
|
|
94
|
+
readonly GG: "GG";
|
|
95
|
+
readonly GN: "GN";
|
|
96
|
+
readonly GW: "GW";
|
|
97
|
+
readonly GY: "GY";
|
|
98
|
+
readonly HT: "HT";
|
|
99
|
+
readonly HM: "HM";
|
|
100
|
+
readonly VA: "VA";
|
|
101
|
+
readonly HN: "HN";
|
|
102
|
+
readonly HK: "HK";
|
|
103
|
+
readonly HU: "HU";
|
|
104
|
+
readonly IS: "IS";
|
|
105
|
+
readonly IN: "IN";
|
|
106
|
+
readonly ID: "ID";
|
|
107
|
+
readonly IR: "IR";
|
|
108
|
+
readonly IQ: "IQ";
|
|
109
|
+
readonly IE: "IE";
|
|
110
|
+
readonly IM: "IM";
|
|
111
|
+
readonly IL: "IL";
|
|
112
|
+
readonly IT: "IT";
|
|
113
|
+
readonly JM: "JM";
|
|
114
|
+
readonly JP: "JP";
|
|
115
|
+
readonly JE: "JE";
|
|
116
|
+
readonly JO: "JO";
|
|
117
|
+
readonly KZ: "KZ";
|
|
118
|
+
readonly KE: "KE";
|
|
119
|
+
readonly KI: "KI";
|
|
120
|
+
readonly KP: "KP";
|
|
121
|
+
readonly KR: "KR";
|
|
122
|
+
readonly KW: "KW";
|
|
123
|
+
readonly KG: "KG";
|
|
124
|
+
readonly LA: "LA";
|
|
125
|
+
readonly LV: "LV";
|
|
126
|
+
readonly LB: "LB";
|
|
127
|
+
readonly LS: "LS";
|
|
128
|
+
readonly LR: "LR";
|
|
129
|
+
readonly LY: "LY";
|
|
130
|
+
readonly LI: "LI";
|
|
131
|
+
readonly LT: "LT";
|
|
132
|
+
readonly LU: "LU";
|
|
133
|
+
readonly MO: "MO";
|
|
134
|
+
readonly MK: "MK";
|
|
135
|
+
readonly MG: "MG";
|
|
136
|
+
readonly MW: "MW";
|
|
137
|
+
readonly MY: "MY";
|
|
138
|
+
readonly MV: "MV";
|
|
139
|
+
readonly ML: "ML";
|
|
140
|
+
readonly MT: "MT";
|
|
141
|
+
readonly MH: "MH";
|
|
142
|
+
readonly MQ: "MQ";
|
|
143
|
+
readonly MR: "MR";
|
|
144
|
+
readonly MU: "MU";
|
|
145
|
+
readonly YT: "YT";
|
|
146
|
+
readonly MX: "MX";
|
|
147
|
+
readonly FM: "FM";
|
|
148
|
+
readonly MD: "MD";
|
|
149
|
+
readonly MC: "MC";
|
|
150
|
+
readonly MN: "MN";
|
|
151
|
+
readonly ME: "ME";
|
|
152
|
+
readonly MS: "MS";
|
|
153
|
+
readonly MA: "MA";
|
|
154
|
+
readonly MZ: "MZ";
|
|
155
|
+
readonly MM: "MM";
|
|
156
|
+
readonly NA: "NA";
|
|
157
|
+
readonly NR: "NR";
|
|
158
|
+
readonly NP: "NP";
|
|
159
|
+
readonly NL: "NL";
|
|
160
|
+
readonly NC: "NC";
|
|
161
|
+
readonly NZ: "NZ";
|
|
162
|
+
readonly NI: "NI";
|
|
163
|
+
readonly NE: "NE";
|
|
164
|
+
readonly NG: "NG";
|
|
165
|
+
readonly NU: "NU";
|
|
166
|
+
readonly NF: "NF";
|
|
167
|
+
readonly MP: "MP";
|
|
168
|
+
readonly NO: "NO";
|
|
169
|
+
readonly OM: "OM";
|
|
170
|
+
readonly PK: "PK";
|
|
171
|
+
readonly PW: "PW";
|
|
172
|
+
readonly PS: "PS";
|
|
173
|
+
readonly PA: "PA";
|
|
174
|
+
readonly PG: "PG";
|
|
175
|
+
readonly PY: "PY";
|
|
176
|
+
readonly PE: "PE";
|
|
177
|
+
readonly PH: "PH";
|
|
178
|
+
readonly PN: "PN";
|
|
179
|
+
readonly PL: "PL";
|
|
180
|
+
readonly PT: "PT";
|
|
181
|
+
readonly PR: "PR";
|
|
182
|
+
readonly QA: "QA";
|
|
183
|
+
readonly RO: "RO";
|
|
184
|
+
readonly RU: "RU";
|
|
185
|
+
readonly RW: "RW";
|
|
186
|
+
readonly RE: "RE";
|
|
187
|
+
readonly BL: "BL";
|
|
188
|
+
readonly SH: "SH";
|
|
189
|
+
readonly KN: "KN";
|
|
190
|
+
readonly LC: "LC";
|
|
191
|
+
readonly MF: "MF";
|
|
192
|
+
readonly PM: "PM";
|
|
193
|
+
readonly VC: "VC";
|
|
194
|
+
readonly WS: "WS";
|
|
195
|
+
readonly SM: "SM";
|
|
196
|
+
readonly ST: "ST";
|
|
197
|
+
readonly SA: "SA";
|
|
198
|
+
readonly SN: "SN";
|
|
199
|
+
readonly RS: "RS";
|
|
200
|
+
readonly SC: "SC";
|
|
201
|
+
readonly SL: "SL";
|
|
202
|
+
readonly SG: "SG";
|
|
203
|
+
readonly SX: "SX";
|
|
204
|
+
readonly SK: "SK";
|
|
205
|
+
readonly SI: "SI";
|
|
206
|
+
readonly SB: "SB";
|
|
207
|
+
readonly SO: "SO";
|
|
208
|
+
readonly ZA: "ZA";
|
|
209
|
+
readonly GS: "GS";
|
|
210
|
+
readonly SS: "SS";
|
|
211
|
+
readonly ES: "ES";
|
|
212
|
+
readonly LK: "LK";
|
|
213
|
+
readonly SD: "SD";
|
|
214
|
+
readonly SR: "SR";
|
|
215
|
+
readonly SJ: "SJ";
|
|
216
|
+
readonly SZ: "SZ";
|
|
217
|
+
readonly SE: "SE";
|
|
218
|
+
readonly CH: "CH";
|
|
219
|
+
readonly SY: "SY";
|
|
220
|
+
readonly TW: "TW";
|
|
221
|
+
readonly TJ: "TJ";
|
|
222
|
+
readonly TZ: "TZ";
|
|
223
|
+
readonly TH: "TH";
|
|
224
|
+
readonly TL: "TL";
|
|
225
|
+
readonly TG: "TG";
|
|
226
|
+
readonly TK: "TK";
|
|
227
|
+
readonly TO: "TO";
|
|
228
|
+
readonly TT: "TT";
|
|
229
|
+
readonly TN: "TN";
|
|
230
|
+
readonly TR: "TR";
|
|
231
|
+
readonly TM: "TM";
|
|
232
|
+
readonly TC: "TC";
|
|
233
|
+
readonly TV: "TV";
|
|
234
|
+
readonly UG: "UG";
|
|
235
|
+
readonly UA: "UA";
|
|
236
|
+
readonly AE: "AE";
|
|
237
|
+
readonly GB: "GB";
|
|
238
|
+
readonly UK: "GB";
|
|
239
|
+
readonly US: "US";
|
|
240
|
+
readonly UM: "UM";
|
|
241
|
+
readonly UY: "UY";
|
|
242
|
+
readonly UZ: "UZ";
|
|
243
|
+
readonly VU: "VU";
|
|
244
|
+
readonly VE: "VE";
|
|
245
|
+
readonly VN: "VN";
|
|
246
|
+
readonly VG: "VG";
|
|
247
|
+
readonly VI: "VI";
|
|
248
|
+
readonly WF: "WF";
|
|
249
|
+
readonly EH: "EH";
|
|
250
|
+
readonly YE: "YE";
|
|
251
|
+
readonly ZM: "ZM";
|
|
252
|
+
readonly ZW: "ZW";
|
|
253
|
+
};
|
|
254
|
+
export declare const ISO31661Alpha2CodeSet: ("AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AI" | "AQ" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BM" | "BT" | "BO" | "BQ" | "BA" | "BW" | "BV" | "BR" | "IO" | "BN" | "BG" | "BF" | "BI" | "CV" | "KH" | "CM" | "CA" | "KY" | "CF" | "TD" | "CL" | "CN" | "CX" | "CC" | "CO" | "KM" | "CG" | "CD" | "CK" | "CR" | "CI" | "HR" | "CU" | "CW" | "CY" | "CZ" | "DK" | "DJ" | "DM" | "DO" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "SZ" | "ET" | "FK" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "TF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GI" | "GR" | "GL" | "GD" | "GP" | "GU" | "GT" | "GG" | "GN" | "GW" | "GY" | "HT" | "HM" | "VA" | "HN" | "HK" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "KP" | "KR" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LY" | "LI" | "LT" | "LU" | "MO" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MH" | "MQ" | "MR" | "MU" | "YT" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "MM" | "NA" | "NR" | "NP" | "NL" | "NC" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "MK" | "MP" | "NO" | "OM" | "PK" | "PW" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PN" | "PL" | "PT" | "PR" | "QA" | "RE" | "RO" | "RU" | "RW" | "BL" | "SH" | "KN" | "LC" | "MF" | "PM" | "VC" | "WS" | "SM" | "ST" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SB" | "SO" | "ZA" | "GS" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SE" | "CH" | "SY" | "TW" | "TJ" | "TZ" | "TH" | "TL" | "TG" | "TK" | "TO" | "TT" | "TN" | "TR" | "TM" | "TC" | "TV" | "UG" | "UA" | "AE" | "GB" | "US" | "UM" | "UY" | "UZ" | "VU" | "VE" | "VN" | "VG" | "VI" | "WF" | "EH" | "YE" | "ZM" | "ZW")[];
|