@formatjs/intl-pluralrules 6.4.0 → 7.0.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/index.d.ts +0 -8
- package/index.js +30 -142
- package/index.js.map +1 -1
- package/locale-data/af.js +24 -2
- package/locale-data/bg.js +32 -2
- package/locale-data/es.js +6 -2
- package/locale-data/fr.js +2 -2
- package/locale-data/gl.js +24 -2
- package/locale-data/tg.d.ts +1 -0
- package/locale-data/tg.js +35 -0
- package/locale-data/vi.js +10 -4
- package/package.json +2 -2
- package/polyfill-force.js +30 -142
- package/polyfill-force.js.map +1 -1
- package/polyfill.iife.js +64 -160
- package/polyfill.js +34 -148
- package/polyfill.js.map +1 -1
- package/should-polyfill.d.ts +0 -2
- package/should-polyfill.js +3 -4
- package/should-polyfill.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Decimal } from "@formatjs/bigdecimal";
|
|
2
|
-
//#region packages/ecma402-abstract/types/core.d.ts
|
|
3
2
|
type Locale = string;
|
|
4
3
|
interface LocaleData<T> {
|
|
5
4
|
data: T;
|
|
6
5
|
locale: Locale;
|
|
7
6
|
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region packages/ecma402-abstract/types/plural-rules.d.ts
|
|
10
7
|
type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other";
|
|
11
8
|
interface PluralRangesData {
|
|
12
9
|
cardinal?: Record<string, LDMLPluralRule>;
|
|
@@ -23,8 +20,6 @@ interface PluralRulesData {
|
|
|
23
20
|
pluralRanges?: PluralRangesData;
|
|
24
21
|
}
|
|
25
22
|
type PluralRulesLocaleData = LocaleData<PluralRulesData>;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region packages/ecma402-abstract/types/number.d.ts
|
|
28
23
|
type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact";
|
|
29
24
|
type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision";
|
|
30
25
|
type NumberFormatRoundingType = "morePrecision" | "lessPrecision" | "significantDigits" | "fractionDigits";
|
|
@@ -54,8 +49,6 @@ interface NumberFormatDigitInternalSlots {
|
|
|
54
49
|
roundingPriority: RoundingPriorityType;
|
|
55
50
|
}
|
|
56
51
|
type TrailingZeroDisplay = "auto" | "stripIfInteger";
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region packages/intl-pluralrules/index.d.ts
|
|
59
52
|
/**
|
|
60
53
|
* Type augmentation for Intl.PluralRules
|
|
61
54
|
*
|
|
@@ -133,6 +126,5 @@ export declare class PluralRules {
|
|
|
133
126
|
static relevantExtensionKeys: never[];
|
|
134
127
|
static polyfilled: boolean;
|
|
135
128
|
}
|
|
136
|
-
//#endregion
|
|
137
129
|
export {};
|
|
138
130
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,66 +1,46 @@
|
|
|
1
1
|
import { LookupSupportedLocales, ResolveLocale } from "@formatjs/intl-localematcher";
|
|
2
2
|
import { Decimal } from "@formatjs/bigdecimal";
|
|
3
|
-
|
|
3
|
+
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-locales@0.0.0/node_modules/@formatjs_generated/cldr.supported-locales/default-content.js
|
|
4
4
|
const defaultContent = {
|
|
5
|
-
"
|
|
6
|
-
"ab": ["ab-GE"],
|
|
5
|
+
"ady": ["ady-RU"],
|
|
7
6
|
"af": ["af-ZA"],
|
|
8
7
|
"agq": ["agq-CM"],
|
|
9
8
|
"ak": ["ak-GH"],
|
|
10
9
|
"am": ["am-ET"],
|
|
11
|
-
"an": ["an-ES"],
|
|
12
|
-
"ann": ["ann-NG"],
|
|
13
|
-
"apc": ["apc-SY"],
|
|
14
10
|
"ar": ["ar-001"],
|
|
15
|
-
"arn": ["arn-CL"],
|
|
16
11
|
"as": ["as-IN"],
|
|
17
12
|
"asa": ["asa-TZ"],
|
|
18
13
|
"ast": ["ast-ES"],
|
|
19
|
-
"az-Arab": ["az-Arab-IR"],
|
|
20
14
|
"az-Cyrl": ["az-Cyrl-AZ"],
|
|
21
15
|
"az-Latn": ["az-Latn-AZ"],
|
|
22
16
|
"ba": ["ba-RU"],
|
|
23
|
-
"bal-Arab": ["bal-Arab-PK"],
|
|
24
17
|
"bal-Latn": ["bal-Latn-PK"],
|
|
25
18
|
"bas": ["bas-CM"],
|
|
26
19
|
"be": ["be-BY"],
|
|
27
20
|
"bem": ["bem-ZM"],
|
|
28
|
-
"bew": ["bew-ID"],
|
|
29
21
|
"bez": ["bez-TZ"],
|
|
30
22
|
"bg": ["bg-BG"],
|
|
31
23
|
"bgc": ["bgc-IN"],
|
|
32
|
-
"bgn": ["bgn-PK"],
|
|
33
24
|
"bho": ["bho-IN"],
|
|
34
25
|
"blo": ["blo-BJ"],
|
|
35
|
-
"blt": ["blt-VN"],
|
|
36
26
|
"bm": ["bm-ML"],
|
|
37
|
-
"bm-Nkoo": ["bm-Nkoo-ML"],
|
|
38
27
|
"bn": ["bn-BD"],
|
|
39
28
|
"bo": ["bo-CN"],
|
|
40
|
-
"bqi": ["bqi-IR"],
|
|
41
29
|
"br": ["br-FR"],
|
|
42
30
|
"brx": ["brx-IN"],
|
|
43
31
|
"bs-Cyrl": ["bs-Cyrl-BA"],
|
|
44
32
|
"bs-Latn": ["bs-Latn-BA"],
|
|
45
|
-
"bss": ["bss-CM"],
|
|
46
33
|
"bua": ["bua-RU"],
|
|
47
|
-
"byn": ["byn-ER"],
|
|
48
34
|
"ca": ["ca-ES"],
|
|
49
|
-
"cad": ["cad-US"],
|
|
50
|
-
"cch": ["cch-NG"],
|
|
51
35
|
"ccp": ["ccp-BD"],
|
|
52
36
|
"ce": ["ce-RU"],
|
|
53
37
|
"ceb": ["ceb-PH"],
|
|
54
38
|
"cgg": ["cgg-UG"],
|
|
55
|
-
"cho": ["cho-US"],
|
|
56
39
|
"chr": ["chr-US"],
|
|
57
|
-
"cic": ["cic-US"],
|
|
58
40
|
"ckb": ["ckb-IQ"],
|
|
59
|
-
"co": ["co-FR"],
|
|
60
41
|
"cop": ["cop-EG"],
|
|
61
42
|
"cs": ["cs-CZ"],
|
|
62
43
|
"csw": ["csw-CA"],
|
|
63
|
-
"cu": ["cu-RU"],
|
|
64
44
|
"cv": ["cv-RU"],
|
|
65
45
|
"cy": ["cy-GB"],
|
|
66
46
|
"da": ["da-DK"],
|
|
@@ -70,14 +50,11 @@ const defaultContent = {
|
|
|
70
50
|
"doi": ["doi-IN"],
|
|
71
51
|
"dsb": ["dsb-DE"],
|
|
72
52
|
"dua": ["dua-CM"],
|
|
73
|
-
"dv": ["dv-MV"],
|
|
74
53
|
"dyo": ["dyo-SN"],
|
|
75
54
|
"dz": ["dz-BT"],
|
|
76
55
|
"ebu": ["ebu-KE"],
|
|
77
56
|
"ee": ["ee-GH"],
|
|
78
57
|
"el": ["el-GR"],
|
|
79
|
-
"en-Dsrt": ["en-Dsrt-US"],
|
|
80
|
-
"en-Shaw": ["en-Shaw-GB"],
|
|
81
58
|
"en": ["en-US"],
|
|
82
59
|
"eo": ["eo-001"],
|
|
83
60
|
"es": ["es-ES"],
|
|
@@ -91,29 +68,23 @@ const defaultContent = {
|
|
|
91
68
|
"fil": ["fil-PH"],
|
|
92
69
|
"fo": ["fo-FO"],
|
|
93
70
|
"fr": ["fr-FR"],
|
|
94
|
-
"frr": ["frr-DE"],
|
|
95
71
|
"fur": ["fur-IT"],
|
|
96
72
|
"fy": ["fy-NL"],
|
|
97
73
|
"ga": ["ga-IE"],
|
|
98
74
|
"gaa": ["gaa-GH"],
|
|
99
75
|
"gd": ["gd-GB"],
|
|
100
|
-
"gez": ["gez-ET"],
|
|
101
76
|
"gl": ["gl-ES"],
|
|
102
|
-
"gn": ["gn-PY"],
|
|
103
77
|
"gsw": ["gsw-CH"],
|
|
104
78
|
"gu": ["gu-IN"],
|
|
105
79
|
"guz": ["guz-KE"],
|
|
106
80
|
"gv": ["gv-IM"],
|
|
107
|
-
"ha-Arab": ["ha-Arab-NG"],
|
|
108
81
|
"ha": ["ha-NG"],
|
|
109
82
|
"haw": ["haw-US"],
|
|
110
83
|
"he": ["he-IL"],
|
|
111
84
|
"hi": ["hi-IN"],
|
|
112
85
|
"hi-Latn": ["hi-Latn-IN"],
|
|
113
|
-
"hnj-Hmnp": ["hnj-Hmnp-US"],
|
|
114
86
|
"hr": ["hr-HR"],
|
|
115
87
|
"hsb": ["hsb-DE"],
|
|
116
|
-
"ht": ["ht-HT"],
|
|
117
88
|
"hu": ["hu-HU"],
|
|
118
89
|
"hy": ["hy-AM"],
|
|
119
90
|
"ia": ["ia-001"],
|
|
@@ -121,27 +92,19 @@ const defaultContent = {
|
|
|
121
92
|
"ie": ["ie-EE"],
|
|
122
93
|
"ig": ["ig-NG"],
|
|
123
94
|
"ii": ["ii-CN"],
|
|
124
|
-
"io": ["io-001"],
|
|
125
95
|
"is": ["is-IS"],
|
|
126
96
|
"it": ["it-IT"],
|
|
127
|
-
"iu": ["iu-CA"],
|
|
128
|
-
"iu-Latn": ["iu-Latn-CA"],
|
|
129
97
|
"ja": ["ja-JP"],
|
|
130
|
-
"jbo": ["jbo-001"],
|
|
131
98
|
"jgo": ["jgo-CM"],
|
|
132
99
|
"jmc": ["jmc-TZ"],
|
|
133
100
|
"jv": ["jv-ID"],
|
|
134
101
|
"ka": ["ka-GE"],
|
|
135
|
-
"kaa-Cyrl": ["kaa-Cyrl-UZ"],
|
|
136
|
-
"kaa-Latn": ["kaa-Latn-UZ"],
|
|
137
102
|
"kab": ["kab-DZ"],
|
|
138
|
-
"kaj": ["kaj-NG"],
|
|
139
103
|
"kam": ["kam-KE"],
|
|
140
|
-
"
|
|
104
|
+
"kbd": ["kbd-RU"],
|
|
141
105
|
"kde": ["kde-TZ"],
|
|
142
106
|
"kea": ["kea-CV"],
|
|
143
107
|
"kek": ["kek-GT"],
|
|
144
|
-
"ken": ["ken-CM"],
|
|
145
108
|
"kgp": ["kgp-BR"],
|
|
146
109
|
"khq": ["khq-ML"],
|
|
147
110
|
"ki": ["ki-KE"],
|
|
@@ -155,13 +118,11 @@ const defaultContent = {
|
|
|
155
118
|
"ko": ["ko-KR"],
|
|
156
119
|
"kok-Deva": ["kok-Deva-IN"],
|
|
157
120
|
"kok-Latn": ["kok-Latn-IN"],
|
|
158
|
-
"kpe": ["kpe-LR"],
|
|
159
121
|
"ks-Arab": ["ks-Arab-IN"],
|
|
160
122
|
"ks-Deva": ["ks-Deva-IN"],
|
|
161
123
|
"ksb": ["ksb-TZ"],
|
|
162
124
|
"ksf": ["ksf-CM"],
|
|
163
125
|
"ksh": ["ksh-DE"],
|
|
164
|
-
"ku-Arab": ["ku-Arab-IQ"],
|
|
165
126
|
"ku-Latn": ["ku-Latn-TR"],
|
|
166
127
|
"kw": ["kw-GB"],
|
|
167
128
|
"kxv-Deva": ["kxv-Deva-IN"],
|
|
@@ -169,7 +130,6 @@ const defaultContent = {
|
|
|
169
130
|
"kxv-Orya": ["kxv-Orya-IN"],
|
|
170
131
|
"kxv-Telu": ["kxv-Telu-IN"],
|
|
171
132
|
"ky": ["ky-KG"],
|
|
172
|
-
"la": ["la-VA"],
|
|
173
133
|
"lag": ["lag-TZ"],
|
|
174
134
|
"lb": ["lb-LU"],
|
|
175
135
|
"lg": ["lg-UG"],
|
|
@@ -181,39 +141,27 @@ const defaultContent = {
|
|
|
181
141
|
"lo": ["lo-LA"],
|
|
182
142
|
"lrc": ["lrc-IR"],
|
|
183
143
|
"lt": ["lt-LT"],
|
|
184
|
-
"ltg": ["ltg-LV"],
|
|
185
144
|
"lu": ["lu-CD"],
|
|
186
145
|
"luo": ["luo-KE"],
|
|
187
146
|
"luy": ["luy-KE"],
|
|
188
147
|
"lv": ["lv-LV"],
|
|
189
|
-
"lzz": ["lzz-TR"],
|
|
190
148
|
"mai": ["mai-IN"],
|
|
191
149
|
"mas": ["mas-KE"],
|
|
192
|
-
"mdf": ["mdf-RU"],
|
|
193
150
|
"mer": ["mer-KE"],
|
|
194
151
|
"mfe": ["mfe-MU"],
|
|
195
152
|
"mg": ["mg-MG"],
|
|
196
153
|
"mgh": ["mgh-MZ"],
|
|
197
154
|
"mgo": ["mgo-CM"],
|
|
198
|
-
"mhn": ["mhn-IT"],
|
|
199
155
|
"mi": ["mi-NZ"],
|
|
200
|
-
"mic": ["mic-CA"],
|
|
201
156
|
"mk": ["mk-MK"],
|
|
202
157
|
"ml": ["ml-IN"],
|
|
203
158
|
"mn": ["mn-MN"],
|
|
204
|
-
"mn-Mong": ["mn-Mong-CN"],
|
|
205
159
|
"mni-Beng": ["mni-Beng-IN"],
|
|
206
|
-
"mni-Mtei": ["mni-Mtei-IN"],
|
|
207
|
-
"moh": ["moh-CA"],
|
|
208
160
|
"mr": ["mr-IN"],
|
|
209
|
-
"ms-Arab": ["ms-Arab-MY"],
|
|
210
161
|
"ms": ["ms-MY"],
|
|
211
162
|
"mt": ["mt-MT"],
|
|
212
163
|
"mua": ["mua-CM"],
|
|
213
|
-
"mus": ["mus-US"],
|
|
214
|
-
"mww-Hmnp": ["mww-Hmnp-US"],
|
|
215
164
|
"my": ["my-MM"],
|
|
216
|
-
"myv": ["myv-RU"],
|
|
217
165
|
"mzn": ["mzn-IR"],
|
|
218
166
|
"naq": ["naq-NA"],
|
|
219
167
|
"nb": ["nb-NO"],
|
|
@@ -225,24 +173,16 @@ const defaultContent = {
|
|
|
225
173
|
"nn": ["nn-NO"],
|
|
226
174
|
"nnh": ["nnh-CM"],
|
|
227
175
|
"nqo": ["nqo-GN"],
|
|
228
|
-
"nr": ["nr-ZA"],
|
|
229
176
|
"nso": ["nso-ZA"],
|
|
230
177
|
"nus": ["nus-SS"],
|
|
231
|
-
"nv": ["nv-US"],
|
|
232
|
-
"ny": ["ny-MW"],
|
|
233
178
|
"nyn": ["nyn-UG"],
|
|
234
179
|
"oc": ["oc-FR"],
|
|
235
|
-
"oka": ["oka-CA"],
|
|
236
180
|
"om": ["om-ET"],
|
|
237
181
|
"or": ["or-IN"],
|
|
238
182
|
"os": ["os-GE"],
|
|
239
|
-
"osa": ["osa-US"],
|
|
240
183
|
"pa-Arab": ["pa-Arab-PK"],
|
|
241
184
|
"pa-Guru": ["pa-Guru-IN"],
|
|
242
|
-
"pap": ["pap-CW"],
|
|
243
185
|
"pcm": ["pcm-NG"],
|
|
244
|
-
"pi-Latn": ["pi-Latn-GB"],
|
|
245
|
-
"pis": ["pis-SB"],
|
|
246
186
|
"pl": ["pl-PL"],
|
|
247
187
|
"pms": ["pms-IT"],
|
|
248
188
|
"prg": ["prg-PL"],
|
|
@@ -251,8 +191,6 @@ const defaultContent = {
|
|
|
251
191
|
"qu": ["qu-PE"],
|
|
252
192
|
"quc": ["quc-GT"],
|
|
253
193
|
"raj": ["raj-IN"],
|
|
254
|
-
"rhg-Rohg": ["rhg-Rohg-MM"],
|
|
255
|
-
"rif": ["rif-MA"],
|
|
256
194
|
"rm": ["rm-CH"],
|
|
257
195
|
"rn": ["rn-BI"],
|
|
258
196
|
"ro": ["ro-RO"],
|
|
@@ -263,41 +201,30 @@ const defaultContent = {
|
|
|
263
201
|
"sa": ["sa-IN"],
|
|
264
202
|
"sah": ["sah-RU"],
|
|
265
203
|
"saq": ["saq-KE"],
|
|
266
|
-
"sat-Deva": ["sat-Deva-IN"],
|
|
267
204
|
"sat-Olck": ["sat-Olck-IN"],
|
|
268
205
|
"sbp": ["sbp-TZ"],
|
|
269
206
|
"sc": ["sc-IT"],
|
|
270
207
|
"scn": ["scn-IT"],
|
|
271
208
|
"sd-Arab": ["sd-Arab-PK"],
|
|
272
209
|
"sd-Deva": ["sd-Deva-IN"],
|
|
273
|
-
"sdh": ["sdh-IR"],
|
|
274
210
|
"se": ["se-NO"],
|
|
275
211
|
"seh": ["seh-MZ"],
|
|
276
212
|
"ses": ["ses-ML"],
|
|
277
213
|
"sg": ["sg-CF"],
|
|
278
|
-
"sgs": ["sgs-LT"],
|
|
279
214
|
"shi-Latn": ["shi-Latn-MA"],
|
|
280
215
|
"shi-Tfng": ["shi-Tfng-MA"],
|
|
281
216
|
"shn": ["shn-MM"],
|
|
282
217
|
"si": ["si-LK"],
|
|
283
|
-
"sid": ["sid-ET"],
|
|
284
218
|
"sk": ["sk-SK"],
|
|
285
|
-
"skr": ["skr-PK"],
|
|
286
219
|
"sl": ["sl-SI"],
|
|
287
|
-
"sma": ["sma-SE"],
|
|
288
|
-
"smj": ["smj-SE"],
|
|
289
220
|
"smn": ["smn-FI"],
|
|
290
|
-
"sms": ["sms-FI"],
|
|
291
221
|
"sn": ["sn-ZW"],
|
|
292
222
|
"so": ["so-SO"],
|
|
293
223
|
"sq": ["sq-AL"],
|
|
294
224
|
"sr-Cyrl": ["sr-Cyrl-RS"],
|
|
295
225
|
"sr-Latn": ["sr-Latn-RS"],
|
|
296
|
-
"ss": ["ss-ZA"],
|
|
297
|
-
"ssy": ["ssy-ER"],
|
|
298
226
|
"st": ["st-ZA"],
|
|
299
227
|
"su-Latn": ["su-Latn-ID"],
|
|
300
|
-
"suz-Deva": ["suz-Deva-NP"],
|
|
301
228
|
"suz-Sunu": ["suz-Sunu-NP"],
|
|
302
229
|
"sv": ["sv-SE"],
|
|
303
230
|
"sw": ["sw-TZ"],
|
|
@@ -309,16 +236,11 @@ const defaultContent = {
|
|
|
309
236
|
"tg": ["tg-TJ"],
|
|
310
237
|
"th": ["th-TH"],
|
|
311
238
|
"ti": ["ti-ET"],
|
|
312
|
-
"tig": ["tig-ER"],
|
|
313
239
|
"tk": ["tk-TM"],
|
|
314
240
|
"tn": ["tn-ZA"],
|
|
315
241
|
"to": ["to-TO"],
|
|
316
242
|
"tok": ["tok-001"],
|
|
317
|
-
"tpi": ["tpi-PG"],
|
|
318
243
|
"tr": ["tr-TR"],
|
|
319
|
-
"trv": ["trv-TW"],
|
|
320
|
-
"trw": ["trw-PK"],
|
|
321
|
-
"ts": ["ts-ZA"],
|
|
322
244
|
"tt": ["tt-RU"],
|
|
323
245
|
"twq": ["twq-NE"],
|
|
324
246
|
"tyv": ["tyv-RU"],
|
|
@@ -331,16 +253,11 @@ const defaultContent = {
|
|
|
331
253
|
"uz-Latn": ["uz-Latn-UZ"],
|
|
332
254
|
"vai-Latn": ["vai-Latn-LR"],
|
|
333
255
|
"vai-Vaii": ["vai-Vaii-LR"],
|
|
334
|
-
"ve": ["ve-ZA"],
|
|
335
256
|
"vec": ["vec-IT"],
|
|
336
257
|
"vi": ["vi-VN"],
|
|
337
258
|
"vmw": ["vmw-MZ"],
|
|
338
|
-
"vo": ["vo-001"],
|
|
339
259
|
"vun": ["vun-TZ"],
|
|
340
|
-
"wa": ["wa-BE"],
|
|
341
260
|
"wae": ["wae-CH"],
|
|
342
|
-
"wal": ["wal-ET"],
|
|
343
|
-
"wbp": ["wbp-AU"],
|
|
344
261
|
"wo": ["wo-SN"],
|
|
345
262
|
"xh": ["xh-ZA"],
|
|
346
263
|
"xnr": ["xnr-IN"],
|
|
@@ -355,11 +272,9 @@ const defaultContent = {
|
|
|
355
272
|
"zgh": ["zgh-MA"],
|
|
356
273
|
"zh-Hans": ["zh-Hans-CN"],
|
|
357
274
|
"zh-Hant": ["zh-Hant-TW"],
|
|
358
|
-
"zh-Latn": ["zh-Latn-CN"],
|
|
359
275
|
"zu": ["zu-ZA"]
|
|
360
276
|
};
|
|
361
|
-
|
|
362
|
-
//#region packages/ecma402-abstract/registerLocaleData.js
|
|
277
|
+
// packages/ecma402-abstract/registerLocaleData.js
|
|
363
278
|
const explicitLocales = /* @__PURE__ */ new WeakMap();
|
|
364
279
|
function registerLocaleData(locale, data, localeData, availableLocales) {
|
|
365
280
|
let loaded = explicitLocales.get(localeData);
|
|
@@ -387,8 +302,7 @@ function registerLocaleData(locale, data, localeData, availableLocales) {
|
|
|
387
302
|
}
|
|
388
303
|
}
|
|
389
304
|
}
|
|
390
|
-
|
|
391
|
-
//#region packages/ecma402-abstract/CanonicalizeLocaleList.js
|
|
305
|
+
// packages/ecma402-abstract/CanonicalizeLocaleList.js
|
|
392
306
|
/**
|
|
393
307
|
* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
|
|
394
308
|
* @param locales
|
|
@@ -396,8 +310,7 @@ function registerLocaleData(locale, data, localeData, availableLocales) {
|
|
|
396
310
|
function CanonicalizeLocaleList(locales) {
|
|
397
311
|
return Intl.getCanonicalLocales(locales);
|
|
398
312
|
}
|
|
399
|
-
|
|
400
|
-
//#region packages/ecma262-abstract/ToObject.js
|
|
313
|
+
// packages/ecma262-abstract/ToObject.js
|
|
401
314
|
/**
|
|
402
315
|
* https://tc39.es/ecma262/#sec-toobject
|
|
403
316
|
*/
|
|
@@ -405,8 +318,7 @@ function ToObject(arg) {
|
|
|
405
318
|
if (arg == null) throw new TypeError("undefined/null cannot be converted to object");
|
|
406
319
|
return Object(arg);
|
|
407
320
|
}
|
|
408
|
-
|
|
409
|
-
//#region packages/ecma262-abstract/ToString.js
|
|
321
|
+
// packages/ecma262-abstract/ToString.js
|
|
410
322
|
/**
|
|
411
323
|
* https://tc39.es/ecma262/#sec-tostring
|
|
412
324
|
*/
|
|
@@ -414,8 +326,7 @@ function ToString(o) {
|
|
|
414
326
|
if (typeof o === "symbol") throw TypeError("Cannot convert a Symbol value to a string");
|
|
415
327
|
return String(o);
|
|
416
328
|
}
|
|
417
|
-
|
|
418
|
-
//#region packages/ecma402-abstract/GetOption.js
|
|
329
|
+
// packages/ecma402-abstract/GetOption.js
|
|
419
330
|
/**
|
|
420
331
|
* https://tc39.es/ecma402/#sec-getoption
|
|
421
332
|
* @param opts
|
|
@@ -436,8 +347,7 @@ function GetOption(opts, prop, type, values, fallback) {
|
|
|
436
347
|
}
|
|
437
348
|
return fallback;
|
|
438
349
|
}
|
|
439
|
-
|
|
440
|
-
//#region packages/ecma402-abstract/SupportedLocales.js
|
|
350
|
+
// packages/ecma402-abstract/SupportedLocales.js
|
|
441
351
|
/**
|
|
442
352
|
* https://tc39.es/ecma402/#sec-supportedlocales
|
|
443
353
|
* @param availableLocales
|
|
@@ -453,8 +363,7 @@ function SupportedLocales(availableLocales, requestedLocales, options) {
|
|
|
453
363
|
if (matcher === "best fit") return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
|
|
454
364
|
return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
|
|
455
365
|
}
|
|
456
|
-
|
|
457
|
-
//#region packages/ecma262-abstract/ToPrimitive.js
|
|
366
|
+
// packages/ecma262-abstract/ToPrimitive.js
|
|
458
367
|
function invariant$1(condition, message, Err = Error) {
|
|
459
368
|
if (!condition) throw new Err(message);
|
|
460
369
|
}
|
|
@@ -497,8 +406,7 @@ function ToPrimitive(input, preferredType) {
|
|
|
497
406
|
}
|
|
498
407
|
return input;
|
|
499
408
|
}
|
|
500
|
-
|
|
501
|
-
//#region packages/ecma402-abstract/ToIntlMathematicalValue.js
|
|
409
|
+
// packages/ecma402-abstract/ToIntlMathematicalValue.js
|
|
502
410
|
/**
|
|
503
411
|
* https://tc39.es/ecma402/#sec-tointlmathematicalvalue
|
|
504
412
|
* Converts input to a mathematical value, supporting BigInt
|
|
@@ -524,8 +432,7 @@ function ToIntlMathematicalValue(input) {
|
|
|
524
432
|
return new Decimal(NaN);
|
|
525
433
|
}
|
|
526
434
|
}
|
|
527
|
-
|
|
528
|
-
//#region packages/ecma402-abstract/CoerceOptionsToObject.js
|
|
435
|
+
// packages/ecma402-abstract/CoerceOptionsToObject.js
|
|
529
436
|
/**
|
|
530
437
|
* https://tc39.es/ecma402/#sec-coerceoptionstoobject
|
|
531
438
|
* @param options
|
|
@@ -535,8 +442,7 @@ function CoerceOptionsToObject(options) {
|
|
|
535
442
|
if (typeof options === "undefined") return Object.create(null);
|
|
536
443
|
return ToObject(options);
|
|
537
444
|
}
|
|
538
|
-
|
|
539
|
-
//#region packages/ecma402-abstract/DefaultNumberOption.js
|
|
445
|
+
// packages/ecma402-abstract/DefaultNumberOption.js
|
|
540
446
|
/**
|
|
541
447
|
* ECMA-402 §9.2.13 DefaultNumberOption, step 2.
|
|
542
448
|
* https://tc39.es/ecma402/#sec-defaultnumberoption
|
|
@@ -552,8 +458,7 @@ function DefaultNumberOption(inputVal, min, max, fallback) {
|
|
|
552
458
|
if (isNaN(val) || val < min || val > max) throw new RangeError(`${val} is outside of range [${min}, ${max}]`);
|
|
553
459
|
return Math.floor(val);
|
|
554
460
|
}
|
|
555
|
-
|
|
556
|
-
//#region packages/ecma402-abstract/GetNumberOption.js
|
|
461
|
+
// packages/ecma402-abstract/GetNumberOption.js
|
|
557
462
|
/**
|
|
558
463
|
* https://tc39.es/ecma402/#sec-getnumberoption
|
|
559
464
|
* @param options
|
|
@@ -566,8 +471,7 @@ function GetNumberOption(options, property, minimum, maximum, fallback) {
|
|
|
566
471
|
const val = options[property];
|
|
567
472
|
return DefaultNumberOption(val, minimum, maximum, fallback);
|
|
568
473
|
}
|
|
569
|
-
|
|
570
|
-
//#region node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js
|
|
474
|
+
// node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js
|
|
571
475
|
function memoize(fn, options) {
|
|
572
476
|
const cache = options && options.cache ? options.cache : cacheDefault;
|
|
573
477
|
const serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
@@ -632,8 +536,7 @@ const strategies = {
|
|
|
632
536
|
variadic: strategyVariadic,
|
|
633
537
|
monadic: strategyMonadic
|
|
634
538
|
};
|
|
635
|
-
|
|
636
|
-
//#region packages/ecma402-abstract/utils.js
|
|
539
|
+
// packages/ecma402-abstract/utils.js
|
|
637
540
|
function repeat(s, times) {
|
|
638
541
|
if (typeof s.repeat === "function") return s.repeat(times);
|
|
639
542
|
const arr = Array.from({ length: times });
|
|
@@ -646,8 +549,7 @@ function invariant(condition, message, Err = Error) {
|
|
|
646
549
|
memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
|
|
647
550
|
memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
|
|
648
551
|
memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
|
|
649
|
-
|
|
650
|
-
//#region packages/ecma402-abstract/NumberFormat/SetNumberFormatDigitOptions.js
|
|
552
|
+
// packages/ecma402-abstract/NumberFormat/SetNumberFormatDigitOptions.js
|
|
651
553
|
const VALID_ROUNDING_INCREMENTS = /* @__PURE__ */ new Set([
|
|
652
554
|
1,
|
|
653
555
|
2,
|
|
@@ -757,8 +659,7 @@ Valid values are ${Array.from(VALID_ROUNDING_INCREMENTS).join(", ")}.`, RangeErr
|
|
|
757
659
|
invariant(internalSlots.maximumFractionDigits === internalSlots.minimumFractionDigits, "With roundingIncrement > 1, maximumFractionDigits and minimumFractionDigits must be equal.", RangeError);
|
|
758
660
|
}
|
|
759
661
|
}
|
|
760
|
-
|
|
761
|
-
//#region packages/ecma402-abstract/PluralRules/InitializePluralRules.js
|
|
662
|
+
// packages/ecma402-abstract/PluralRules/InitializePluralRules.js
|
|
762
663
|
function InitializePluralRules(pl, locales, options, { availableLocales, relevantExtensionKeys, localeData, getDefaultLocale, getInternalSlots }) {
|
|
763
664
|
const requestedLocales = CanonicalizeLocaleList(locales);
|
|
764
665
|
const opt = Object.create(null);
|
|
@@ -784,8 +685,7 @@ function InitializePluralRules(pl, locales, options, { availableLocales, relevan
|
|
|
784
685
|
SetNumberFormatDigitOptions(internalSlots, opts, 0, 3, notation);
|
|
785
686
|
return pl;
|
|
786
687
|
}
|
|
787
|
-
|
|
788
|
-
//#region packages/ecma262-abstract/Type.js
|
|
688
|
+
// packages/ecma262-abstract/Type.js
|
|
789
689
|
/**
|
|
790
690
|
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
|
|
791
691
|
*/
|
|
@@ -799,12 +699,10 @@ function Type(x) {
|
|
|
799
699
|
if (typeof x === "symbol") return "Symbol";
|
|
800
700
|
if (typeof x === "bigint") return "BigInt";
|
|
801
701
|
}
|
|
802
|
-
|
|
803
|
-
//#region packages/ecma402-abstract/constants.js
|
|
702
|
+
// packages/ecma402-abstract/constants.js
|
|
804
703
|
const ZERO = new Decimal(0);
|
|
805
704
|
const NEGATIVE_ZERO = new Decimal(-0);
|
|
806
|
-
|
|
807
|
-
//#region packages/ecma402-abstract/NumberFormat/GetUnsignedRoundingMode.js
|
|
705
|
+
// packages/ecma402-abstract/NumberFormat/GetUnsignedRoundingMode.js
|
|
808
706
|
const negativeMapping = {
|
|
809
707
|
ceil: "zero",
|
|
810
708
|
floor: "infinity",
|
|
@@ -831,8 +729,7 @@ function GetUnsignedRoundingMode(roundingMode, isNegative) {
|
|
|
831
729
|
if (isNegative) return negativeMapping[roundingMode];
|
|
832
730
|
return positiveMapping[roundingMode];
|
|
833
731
|
}
|
|
834
|
-
|
|
835
|
-
//#region packages/ecma402-abstract/NumberFormat/ApplyUnsignedRoundingMode.js
|
|
732
|
+
// packages/ecma402-abstract/NumberFormat/ApplyUnsignedRoundingMode.js
|
|
836
733
|
function ApplyUnsignedRoundingMode(x, r1, r2, unsignedRoundingMode) {
|
|
837
734
|
if (x.eq(r1) || r1.eq(r2)) return r1;
|
|
838
735
|
if (x.eq(r2)) return r2;
|
|
@@ -850,8 +747,7 @@ function ApplyUnsignedRoundingMode(x, r1, r2, unsignedRoundingMode) {
|
|
|
850
747
|
if (r1.div(r2.minus(r1)).mod(2).isZero()) return r1;
|
|
851
748
|
return r2;
|
|
852
749
|
}
|
|
853
|
-
|
|
854
|
-
//#region packages/ecma402-abstract/NumberFormat/decimal-cache.js
|
|
750
|
+
// packages/ecma402-abstract/NumberFormat/decimal-cache.js
|
|
855
751
|
/**
|
|
856
752
|
* Cached function to compute powers of 10 for Decimal.js operations.
|
|
857
753
|
* This cache significantly reduces overhead in ComputeExponent and ToRawFixed
|
|
@@ -865,8 +761,7 @@ function ApplyUnsignedRoundingMode(x, r1, r2, unsignedRoundingMode) {
|
|
|
865
761
|
const getPowerOf10 = memoize((exponent) => {
|
|
866
762
|
return Decimal.pow(10, exponent);
|
|
867
763
|
});
|
|
868
|
-
|
|
869
|
-
//#region packages/ecma402-abstract/NumberFormat/ToRawFixed.js
|
|
764
|
+
// packages/ecma402-abstract/NumberFormat/ToRawFixed.js
|
|
870
765
|
function ToRawFixedFn(n, f) {
|
|
871
766
|
return n.times(getPowerOf10(-f));
|
|
872
767
|
}
|
|
@@ -931,8 +826,7 @@ function ToRawFixed(x, minFraction, maxFraction, roundingIncrement, unsignedRoun
|
|
|
931
826
|
roundingMagnitude: -f
|
|
932
827
|
};
|
|
933
828
|
}
|
|
934
|
-
|
|
935
|
-
//#region packages/ecma402-abstract/NumberFormat/ToRawPrecision.js
|
|
829
|
+
// packages/ecma402-abstract/NumberFormat/ToRawPrecision.js
|
|
936
830
|
function findN1E1R1(x, p) {
|
|
937
831
|
const maxN1 = getPowerOf10(p);
|
|
938
832
|
const minN1 = getPowerOf10(p - 1);
|
|
@@ -1067,8 +961,7 @@ function ToRawPrecision(x, minPrecision, maxPrecision, unsignedRoundingMode) {
|
|
|
1067
961
|
roundingMagnitude: e - p + 1
|
|
1068
962
|
};
|
|
1069
963
|
}
|
|
1070
|
-
|
|
1071
|
-
//#region packages/ecma402-abstract/NumberFormat/FormatNumericToString.js
|
|
964
|
+
// packages/ecma402-abstract/NumberFormat/FormatNumericToString.js
|
|
1072
965
|
/**
|
|
1073
966
|
* https://tc39.es/ecma402/#sec-formatnumberstring
|
|
1074
967
|
*/
|
|
@@ -1124,8 +1017,7 @@ function FormatNumericToString(intlObject, _x) {
|
|
|
1124
1017
|
formattedString: string
|
|
1125
1018
|
};
|
|
1126
1019
|
}
|
|
1127
|
-
|
|
1128
|
-
//#region packages/ecma402-abstract/PluralRules/ResolvePlural.js
|
|
1020
|
+
// packages/ecma402-abstract/PluralRules/ResolvePlural.js
|
|
1129
1021
|
/**
|
|
1130
1022
|
* ResolvePluralInternal ( pluralRules, n )
|
|
1131
1023
|
*
|
|
@@ -1184,8 +1076,7 @@ function ResolvePlural(pl, n, { getInternalSlots, PluralRuleSelect }) {
|
|
|
1184
1076
|
PluralRuleSelect
|
|
1185
1077
|
}).pluralCategory;
|
|
1186
1078
|
}
|
|
1187
|
-
|
|
1188
|
-
//#region packages/ecma402-abstract/PluralRules/ResolvePluralRange.js
|
|
1079
|
+
// packages/ecma402-abstract/PluralRules/ResolvePluralRange.js
|
|
1189
1080
|
/**
|
|
1190
1081
|
* ResolvePluralRange ( pluralRules, x, y )
|
|
1191
1082
|
*
|
|
@@ -1220,8 +1111,7 @@ function ResolvePluralRange(pluralRules, x, y, { getInternalSlots, PluralRuleSel
|
|
|
1220
1111
|
const { locale, type } = internalSlots;
|
|
1221
1112
|
return PluralRuleSelectRange(locale, type, xp.pluralCategory, yp.pluralCategory);
|
|
1222
1113
|
}
|
|
1223
|
-
|
|
1224
|
-
//#region packages/intl-pluralrules/get_internal_slots.ts
|
|
1114
|
+
// packages/intl-pluralrules/get_internal_slots.ts
|
|
1225
1115
|
const internalSlotMap = /* @__PURE__ */ new WeakMap();
|
|
1226
1116
|
function getInternalSlots(x) {
|
|
1227
1117
|
let internalSlots = internalSlotMap.get(x);
|
|
@@ -1231,8 +1121,7 @@ function getInternalSlots(x) {
|
|
|
1231
1121
|
}
|
|
1232
1122
|
return internalSlots;
|
|
1233
1123
|
}
|
|
1234
|
-
|
|
1235
|
-
//#region packages/intl-pluralrules/index.ts
|
|
1124
|
+
// packages/intl-pluralrules/index.ts
|
|
1236
1125
|
function validateInstance(instance, method) {
|
|
1237
1126
|
if (!(instance instanceof PluralRules)) throw new TypeError(`Method Intl.PluralRules.prototype.${method} called on incompatible receiver ${String(instance)}`);
|
|
1238
1127
|
}
|
|
@@ -1434,7 +1323,6 @@ try {
|
|
|
1434
1323
|
configurable: true
|
|
1435
1324
|
});
|
|
1436
1325
|
} catch {}
|
|
1437
|
-
//#endregion
|
|
1438
1326
|
export { PluralRules };
|
|
1439
1327
|
|
|
1440
1328
|
//# sourceMappingURL=index.js.map
|