@formatjs/intl-pluralrules 6.3.6 → 6.3.8
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.js.map +1 -1
- package/locale-data/blo.d.ts +1 -0
- package/locale-data/blo.js +51 -0
- package/locale-data/csw.d.ts +1 -0
- package/locale-data/csw.js +33 -0
- package/locale-data/cv.d.ts +1 -0
- package/locale-data/cv.js +37 -0
- package/locale-data/ie.d.ts +1 -0
- package/locale-data/ie.js +35 -0
- package/locale-data/kok-Latn.d.ts +1 -0
- package/locale-data/kok-Latn.js +47 -0
- package/locale-data/kok.d.ts +1 -0
- package/locale-data/kok.js +47 -0
- package/locale-data/lld.d.ts +1 -0
- package/locale-data/lld.js +47 -0
- package/locale-data/sgs.d.ts +1 -0
- package/locale-data/sgs.js +49 -0
- package/locale-data/vec.d.ts +1 -0
- package/locale-data/vec.js +47 -0
- package/package.json +5 -5
- package/polyfill-force.js +18 -6
- package/polyfill-force.js.map +1 -1
- package/polyfill.iife.js +102 -96
- package/polyfill.js +29 -7
- package/polyfill.js.map +1 -1
- package/should-polyfill.js +10 -1
- package/should-polyfill.js.map +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
5
|
+
const numStr = String(num);
|
|
6
|
+
const parts = numStr.split(".");
|
|
7
|
+
const integerPart = parts[0];
|
|
8
|
+
const decimalPart = parts[1] || "";
|
|
9
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
10
|
+
const v = decimalPart.length;
|
|
11
|
+
if (isOrdinal) {
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
if (i === 1 && v === 0)
|
|
15
|
+
return "one";
|
|
16
|
+
}
|
|
17
|
+
return "other";
|
|
18
|
+
}},"locale":"ie"})
|
|
19
|
+
} else {
|
|
20
|
+
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
21
|
+
const numStr = String(num);
|
|
22
|
+
const parts = numStr.split(".");
|
|
23
|
+
const integerPart = parts[0];
|
|
24
|
+
const decimalPart = parts[1] || "";
|
|
25
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
26
|
+
const v = decimalPart.length;
|
|
27
|
+
if (isOrdinal) {
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
if (i === 1 && v === 0)
|
|
31
|
+
return "one";
|
|
32
|
+
}
|
|
33
|
+
return "other";
|
|
34
|
+
}},"locale":"ie"})
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","one","other","two"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
5
|
+
const numStr = String(num);
|
|
6
|
+
const parts = numStr.split(".");
|
|
7
|
+
const integerPart = parts[0];
|
|
8
|
+
const decimalPart = parts[1] || "";
|
|
9
|
+
const n = Math.abs(parseFloat(numStr));
|
|
10
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
11
|
+
if (isOrdinal) {
|
|
12
|
+
if (n === 4)
|
|
13
|
+
return "few";
|
|
14
|
+
if (n === 1)
|
|
15
|
+
return "one";
|
|
16
|
+
if ((n === 2 || n === 3))
|
|
17
|
+
return "two";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
if (i === 0 || n === 1)
|
|
21
|
+
return "one";
|
|
22
|
+
}
|
|
23
|
+
return "other";
|
|
24
|
+
}},"locale":"kok-Latn"})
|
|
25
|
+
} else {
|
|
26
|
+
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","one","other","two"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
27
|
+
const numStr = String(num);
|
|
28
|
+
const parts = numStr.split(".");
|
|
29
|
+
const integerPart = parts[0];
|
|
30
|
+
const decimalPart = parts[1] || "";
|
|
31
|
+
const n = Math.abs(parseFloat(numStr));
|
|
32
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
33
|
+
if (isOrdinal) {
|
|
34
|
+
if (n === 4)
|
|
35
|
+
return "few";
|
|
36
|
+
if (n === 1)
|
|
37
|
+
return "one";
|
|
38
|
+
if ((n === 2 || n === 3))
|
|
39
|
+
return "two";
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (i === 0 || n === 1)
|
|
43
|
+
return "one";
|
|
44
|
+
}
|
|
45
|
+
return "other";
|
|
46
|
+
}},"locale":"kok-Latn"})
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","one","other","two"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
5
|
+
const numStr = String(num);
|
|
6
|
+
const parts = numStr.split(".");
|
|
7
|
+
const integerPart = parts[0];
|
|
8
|
+
const decimalPart = parts[1] || "";
|
|
9
|
+
const n = Math.abs(parseFloat(numStr));
|
|
10
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
11
|
+
if (isOrdinal) {
|
|
12
|
+
if (n === 4)
|
|
13
|
+
return "few";
|
|
14
|
+
if (n === 1)
|
|
15
|
+
return "one";
|
|
16
|
+
if ((n === 2 || n === 3))
|
|
17
|
+
return "two";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
if (i === 0 || n === 1)
|
|
21
|
+
return "one";
|
|
22
|
+
}
|
|
23
|
+
return "other";
|
|
24
|
+
}},"locale":"kok"})
|
|
25
|
+
} else {
|
|
26
|
+
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["few","one","other","two"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
27
|
+
const numStr = String(num);
|
|
28
|
+
const parts = numStr.split(".");
|
|
29
|
+
const integerPart = parts[0];
|
|
30
|
+
const decimalPart = parts[1] || "";
|
|
31
|
+
const n = Math.abs(parseFloat(numStr));
|
|
32
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
33
|
+
if (isOrdinal) {
|
|
34
|
+
if (n === 4)
|
|
35
|
+
return "few";
|
|
36
|
+
if (n === 1)
|
|
37
|
+
return "one";
|
|
38
|
+
if ((n === 2 || n === 3))
|
|
39
|
+
return "two";
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (i === 0 || n === 1)
|
|
43
|
+
return "one";
|
|
44
|
+
}
|
|
45
|
+
return "other";
|
|
46
|
+
}},"locale":"kok"})
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["many","other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
5
|
+
const numStr = String(num);
|
|
6
|
+
const parts = numStr.split(".");
|
|
7
|
+
const integerPart = parts[0];
|
|
8
|
+
const decimalPart = parts[1] || "";
|
|
9
|
+
const n = Math.abs(parseFloat(numStr));
|
|
10
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
11
|
+
const v = decimalPart.length;
|
|
12
|
+
const e = exponent;
|
|
13
|
+
if (isOrdinal) {
|
|
14
|
+
if ((((n === 11 || n === 8) || n === 80) || n === 800))
|
|
15
|
+
return "many";
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
if (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
19
|
+
return "many";
|
|
20
|
+
if (i === 1 && v === 0)
|
|
21
|
+
return "one";
|
|
22
|
+
}
|
|
23
|
+
return "other";
|
|
24
|
+
}},"locale":"lld"})
|
|
25
|
+
} else {
|
|
26
|
+
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["many","other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
27
|
+
const numStr = String(num);
|
|
28
|
+
const parts = numStr.split(".");
|
|
29
|
+
const integerPart = parts[0];
|
|
30
|
+
const decimalPart = parts[1] || "";
|
|
31
|
+
const n = Math.abs(parseFloat(numStr));
|
|
32
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
33
|
+
const v = decimalPart.length;
|
|
34
|
+
const e = exponent;
|
|
35
|
+
if (isOrdinal) {
|
|
36
|
+
if ((((n === 11 || n === 8) || n === 80) || n === 800))
|
|
37
|
+
return "many";
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
41
|
+
return "many";
|
|
42
|
+
if (i === 1 && v === 0)
|
|
43
|
+
return "one";
|
|
44
|
+
}
|
|
45
|
+
return "other";
|
|
46
|
+
}},"locale":"lld"})
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["few","many","one","other","two"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
5
|
+
const numStr = String(num);
|
|
6
|
+
const parts = numStr.split(".");
|
|
7
|
+
const integerPart = parts[0];
|
|
8
|
+
const decimalPart = parts[1] || "";
|
|
9
|
+
const n = Math.abs(parseFloat(numStr));
|
|
10
|
+
const v = decimalPart.length;
|
|
11
|
+
const f = v > 0 ? parseInt(decimalPart, 10) : 0;
|
|
12
|
+
if (isOrdinal) {
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
if (n !== 2 && ((n % 10) >= 2 && (n % 10) <= 9) && ((n % 100) < 11 || (n % 100) > 19))
|
|
16
|
+
return "few";
|
|
17
|
+
if (f !== 0)
|
|
18
|
+
return "many";
|
|
19
|
+
if ((n % 10) === 1 && (n % 100) !== 11)
|
|
20
|
+
return "one";
|
|
21
|
+
if (n === 2)
|
|
22
|
+
return "two";
|
|
23
|
+
}
|
|
24
|
+
return "other";
|
|
25
|
+
}},"locale":"sgs"})
|
|
26
|
+
} else {
|
|
27
|
+
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["few","many","one","other","two"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
28
|
+
const numStr = String(num);
|
|
29
|
+
const parts = numStr.split(".");
|
|
30
|
+
const integerPart = parts[0];
|
|
31
|
+
const decimalPart = parts[1] || "";
|
|
32
|
+
const n = Math.abs(parseFloat(numStr));
|
|
33
|
+
const v = decimalPart.length;
|
|
34
|
+
const f = v > 0 ? parseInt(decimalPart, 10) : 0;
|
|
35
|
+
if (isOrdinal) {
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (n !== 2 && ((n % 10) >= 2 && (n % 10) <= 9) && ((n % 100) < 11 || (n % 100) > 19))
|
|
39
|
+
return "few";
|
|
40
|
+
if (f !== 0)
|
|
41
|
+
return "many";
|
|
42
|
+
if ((n % 10) === 1 && (n % 100) !== 11)
|
|
43
|
+
return "one";
|
|
44
|
+
if (n === 2)
|
|
45
|
+
return "two";
|
|
46
|
+
}
|
|
47
|
+
return "other";
|
|
48
|
+
}},"locale":"sgs"})
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["many","other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
5
|
+
const numStr = String(num);
|
|
6
|
+
const parts = numStr.split(".");
|
|
7
|
+
const integerPart = parts[0];
|
|
8
|
+
const decimalPart = parts[1] || "";
|
|
9
|
+
const n = Math.abs(parseFloat(numStr));
|
|
10
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
11
|
+
const v = decimalPart.length;
|
|
12
|
+
const e = exponent;
|
|
13
|
+
if (isOrdinal) {
|
|
14
|
+
if ((((n === 11 || n === 8) || n === 80) || n === 800))
|
|
15
|
+
return "many";
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
if (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
19
|
+
return "many";
|
|
20
|
+
if (i === 1 && v === 0)
|
|
21
|
+
return "one";
|
|
22
|
+
}
|
|
23
|
+
return "other";
|
|
24
|
+
}},"locale":"vec"})
|
|
25
|
+
} else {
|
|
26
|
+
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["many","other"]},"fn":function(num, isOrdinal, exponent = 0) {
|
|
27
|
+
const numStr = String(num);
|
|
28
|
+
const parts = numStr.split(".");
|
|
29
|
+
const integerPart = parts[0];
|
|
30
|
+
const decimalPart = parts[1] || "";
|
|
31
|
+
const n = Math.abs(parseFloat(numStr));
|
|
32
|
+
const i = Math.floor(Math.abs(parseFloat(integerPart)));
|
|
33
|
+
const v = decimalPart.length;
|
|
34
|
+
const e = exponent;
|
|
35
|
+
if (isOrdinal) {
|
|
36
|
+
if ((((n === 11 || n === 8) || n === 80) || n === 800))
|
|
37
|
+
return "many";
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
41
|
+
return "many";
|
|
42
|
+
if (i === 1 && v === 0)
|
|
43
|
+
return "one";
|
|
44
|
+
}
|
|
45
|
+
return "other";
|
|
46
|
+
}},"locale":"vec"})
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-pluralrules",
|
|
3
3
|
"description": "Polyfill for Intl.PluralRules",
|
|
4
|
-
"version": "6.3.
|
|
4
|
+
"version": "6.3.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Long Ho <holevietlong@gmail.com>",
|
|
7
7
|
"type": "module",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"./locale-data": "./locale-data"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@formatjs/bigdecimal": "0.2.
|
|
19
|
-
"@formatjs/intl-localematcher": "0.8.
|
|
18
|
+
"@formatjs/bigdecimal": "0.2.5",
|
|
19
|
+
"@formatjs/intl-localematcher": "0.8.8"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@formatjs/intl-
|
|
23
|
-
"@formatjs/intl-
|
|
22
|
+
"@formatjs/intl-getcanonicallocales": "3.2.9",
|
|
23
|
+
"@formatjs/intl-locale": "5.3.8"
|
|
24
24
|
},
|
|
25
25
|
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
26
26
|
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
|
package/polyfill-force.js
CHANGED
|
@@ -242,6 +242,23 @@ function repeat(s, times) {
|
|
|
242
242
|
for (let i = 0; i < arr.length; i++) arr[i] = s;
|
|
243
243
|
return arr.join("");
|
|
244
244
|
}
|
|
245
|
+
function defineProperty(target, name, { value }) {
|
|
246
|
+
Object.defineProperty(target, name, {
|
|
247
|
+
configurable: true,
|
|
248
|
+
enumerable: false,
|
|
249
|
+
writable: true,
|
|
250
|
+
value
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function ensureIntl() {
|
|
254
|
+
if (typeof Intl === "undefined") Object.defineProperty(globalThis, "Intl", {
|
|
255
|
+
configurable: true,
|
|
256
|
+
enumerable: false,
|
|
257
|
+
writable: true,
|
|
258
|
+
value: {}
|
|
259
|
+
});
|
|
260
|
+
return Intl;
|
|
261
|
+
}
|
|
245
262
|
function invariant$1(condition, message, Err = Error) {
|
|
246
263
|
if (!condition) throw new Err(message);
|
|
247
264
|
}
|
|
@@ -1120,12 +1137,7 @@ try {
|
|
|
1120
1137
|
} catch {}
|
|
1121
1138
|
//#endregion
|
|
1122
1139
|
//#region packages/intl-pluralrules/polyfill-force.ts
|
|
1123
|
-
|
|
1124
|
-
value: PluralRules,
|
|
1125
|
-
writable: true,
|
|
1126
|
-
enumerable: false,
|
|
1127
|
-
configurable: true
|
|
1128
|
-
});
|
|
1140
|
+
defineProperty(ensureIntl(), "PluralRules", { value: PluralRules });
|
|
1129
1141
|
const buf = globalThis.__FORMATJS_PLURALRULES_DATA__;
|
|
1130
1142
|
if (buf) {
|
|
1131
1143
|
for (const d of buf) PluralRules.__addLocaleData(d);
|