@formatjs/intl-pluralrules 6.1.0 → 6.1.2

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/polyfill.js CHANGED
@@ -1,10 +1,10 @@
1
- import { PluralRules } from './index.js';
2
- import { shouldPolyfill } from './should-polyfill.js';
1
+ import { PluralRules } from "./index.js";
2
+ import { shouldPolyfill } from "./should-polyfill.js";
3
3
  if (shouldPolyfill()) {
4
- Object.defineProperty(Intl, 'PluralRules', {
5
- value: PluralRules,
6
- writable: true,
7
- enumerable: false,
8
- configurable: true,
9
- });
4
+ Object.defineProperty(Intl, "PluralRules", {
5
+ value: PluralRules,
6
+ writable: true,
7
+ enumerable: false,
8
+ configurable: true
9
+ });
10
10
  }
@@ -1,18 +1,14 @@
1
- import { match } from '@formatjs/intl-localematcher';
2
- import { supportedLocales } from './supported-locales.generated.js';
1
+ import { match } from "@formatjs/intl-localematcher";
2
+ import { supportedLocales } from "./supported-locales.generated.js";
3
3
  function supportedLocalesOf(locale) {
4
- if (!locale) {
5
- return true;
6
- }
7
- var locales = Array.isArray(locale) ? locale : [locale];
8
- return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
4
+ if (!locale) {
5
+ return true;
6
+ }
7
+ const locales = Array.isArray(locale) ? locale : [locale];
8
+ return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
9
9
  }
10
- export function shouldPolyfill(locale) {
11
- if (locale === void 0) { locale = 'en'; }
12
- if (!('PluralRules' in Intl) ||
13
- new Intl.PluralRules('en', { minimumFractionDigits: 2 }).select(1) ===
14
- 'one' ||
15
- !supportedLocalesOf(locale)) {
16
- return locale ? match([locale], supportedLocales, 'en') : undefined;
17
- }
10
+ export function shouldPolyfill(locale = "en") {
11
+ if (!("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale)) {
12
+ return locale ? match([locale], supportedLocales, "en") : undefined;
13
+ }
18
14
  }
@@ -1 +1,217 @@
1
- export var supportedLocales = ["af", "ak", "am", "an", "ar", "ars", "as", "asa", "ast", "az", "bal", "be", "bem", "bez", "bg", "bho", "bm", "bn", "bo", "br", "brx", "bs", "ca", "ce", "ceb", "cgg", "chr", "ckb", "cs", "cy", "da", "de", "doi", "dsb", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fil", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gsw", "gu", "guw", "gv", "ha", "haw", "he", "hi", "hnj", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "io", "is", "it", "iu", "ja", "jbo", "jgo", "jmc", "jv", "jw", "ka", "kab", "kaj", "kcg", "kde", "kea", "kk", "kkj", "kl", "km", "kn", "ko", "ks", "ksb", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lij", "lkt", "ln", "lo", "lt", "lv", "mas", "mg", "mgo", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "nah", "naq", "nb", "nd", "ne", "nl", "nn", "nnh", "no", "nqo", "nr", "nso", "ny", "nyn", "om", "or", "os", "osa", "pa", "pap", "pcm", "pl", "prg", "ps", "pt", "pt-PT", "rm", "ro", "rof", "ru", "rwk", "sah", "saq", "sat", "sc", "scn", "sd", "sdh", "se", "seh", "ses", "sg", "sh", "shi", "si", "sk", "sl", "sma", "smi", "smj", "smn", "sms", "sn", "so", "sq", "sr", "ss", "ssy", "st", "su", "sv", "sw", "syr", "ta", "te", "teo", "th", "ti", "tig", "tk", "tl", "tn", "to", "tpi", "tr", "ts", "tzm", "ug", "uk", "und", "ur", "uz", "ve", "vi", "vo", "vun", "wa", "wae", "wo", "xh", "xog", "yi", "yo", "yue", "zh", "zu"];
1
+ export const supportedLocales = [
2
+ "af",
3
+ "ak",
4
+ "am",
5
+ "an",
6
+ "ar",
7
+ "ars",
8
+ "as",
9
+ "asa",
10
+ "ast",
11
+ "az",
12
+ "bal",
13
+ "be",
14
+ "bem",
15
+ "bez",
16
+ "bg",
17
+ "bho",
18
+ "bm",
19
+ "bn",
20
+ "bo",
21
+ "br",
22
+ "brx",
23
+ "bs",
24
+ "ca",
25
+ "ce",
26
+ "ceb",
27
+ "cgg",
28
+ "chr",
29
+ "ckb",
30
+ "cs",
31
+ "cy",
32
+ "da",
33
+ "de",
34
+ "doi",
35
+ "dsb",
36
+ "dv",
37
+ "dz",
38
+ "ee",
39
+ "el",
40
+ "en",
41
+ "eo",
42
+ "es",
43
+ "et",
44
+ "eu",
45
+ "fa",
46
+ "ff",
47
+ "fi",
48
+ "fil",
49
+ "fo",
50
+ "fr",
51
+ "fur",
52
+ "fy",
53
+ "ga",
54
+ "gd",
55
+ "gl",
56
+ "gsw",
57
+ "gu",
58
+ "guw",
59
+ "gv",
60
+ "ha",
61
+ "haw",
62
+ "he",
63
+ "hi",
64
+ "hnj",
65
+ "hr",
66
+ "hsb",
67
+ "hu",
68
+ "hy",
69
+ "ia",
70
+ "id",
71
+ "ig",
72
+ "ii",
73
+ "io",
74
+ "is",
75
+ "it",
76
+ "iu",
77
+ "ja",
78
+ "jbo",
79
+ "jgo",
80
+ "jmc",
81
+ "jv",
82
+ "jw",
83
+ "ka",
84
+ "kab",
85
+ "kaj",
86
+ "kcg",
87
+ "kde",
88
+ "kea",
89
+ "kk",
90
+ "kkj",
91
+ "kl",
92
+ "km",
93
+ "kn",
94
+ "ko",
95
+ "ks",
96
+ "ksb",
97
+ "ksh",
98
+ "ku",
99
+ "kw",
100
+ "ky",
101
+ "lag",
102
+ "lb",
103
+ "lg",
104
+ "lij",
105
+ "lkt",
106
+ "ln",
107
+ "lo",
108
+ "lt",
109
+ "lv",
110
+ "mas",
111
+ "mg",
112
+ "mgo",
113
+ "mk",
114
+ "ml",
115
+ "mn",
116
+ "mo",
117
+ "mr",
118
+ "ms",
119
+ "mt",
120
+ "my",
121
+ "nah",
122
+ "naq",
123
+ "nb",
124
+ "nd",
125
+ "ne",
126
+ "nl",
127
+ "nn",
128
+ "nnh",
129
+ "no",
130
+ "nqo",
131
+ "nr",
132
+ "nso",
133
+ "ny",
134
+ "nyn",
135
+ "om",
136
+ "or",
137
+ "os",
138
+ "osa",
139
+ "pa",
140
+ "pap",
141
+ "pcm",
142
+ "pl",
143
+ "prg",
144
+ "ps",
145
+ "pt",
146
+ "pt-PT",
147
+ "rm",
148
+ "ro",
149
+ "rof",
150
+ "ru",
151
+ "rwk",
152
+ "sah",
153
+ "saq",
154
+ "sat",
155
+ "sc",
156
+ "scn",
157
+ "sd",
158
+ "sdh",
159
+ "se",
160
+ "seh",
161
+ "ses",
162
+ "sg",
163
+ "sh",
164
+ "shi",
165
+ "si",
166
+ "sk",
167
+ "sl",
168
+ "sma",
169
+ "smi",
170
+ "smj",
171
+ "smn",
172
+ "sms",
173
+ "sn",
174
+ "so",
175
+ "sq",
176
+ "sr",
177
+ "ss",
178
+ "ssy",
179
+ "st",
180
+ "su",
181
+ "sv",
182
+ "sw",
183
+ "syr",
184
+ "ta",
185
+ "te",
186
+ "teo",
187
+ "th",
188
+ "ti",
189
+ "tig",
190
+ "tk",
191
+ "tl",
192
+ "tn",
193
+ "to",
194
+ "tpi",
195
+ "tr",
196
+ "ts",
197
+ "tzm",
198
+ "ug",
199
+ "uk",
200
+ "und",
201
+ "ur",
202
+ "uz",
203
+ "ve",
204
+ "vi",
205
+ "vo",
206
+ "vun",
207
+ "wa",
208
+ "wae",
209
+ "wo",
210
+ "xh",
211
+ "xog",
212
+ "yi",
213
+ "yo",
214
+ "yue",
215
+ "zh",
216
+ "zu"
217
+ ];