@formatjs/intl-pluralrules 4.1.5 → 4.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/abstract/GetOperands.js +6 -6
- package/abstract/InitializePluralRules.js +6 -6
- package/abstract/ResolvePlural.js +5 -5
- package/index.js +9 -9
- package/lib/index.js +3 -3
- package/lib/should-polyfill.d.ts +1 -1
- package/lib/should-polyfill.d.ts.map +1 -1
- package/lib/should-polyfill.js +7 -2
- package/lib/supported-locales.d.ts +2 -0
- package/lib/supported-locales.d.ts.map +1 -0
- package/lib/supported-locales.js +2 -0
- package/locale-data/{in.d.ts → bal.d.ts} +0 -0
- package/locale-data/bal.js +7 -0
- package/locale-data/es.js +5 -2
- package/locale-data/{iw.d.ts → hnj.d.ts} +0 -0
- package/locale-data/{in.js → hnj.js} +1 -1
- package/locale-data/it.js +5 -3
- package/locale-data/pt-PT.js +5 -3
- package/locale-data/pt.js +5 -3
- package/locale-data/{ji.d.ts → tpi.d.ts} +0 -0
- package/locale-data/tpi.js +7 -0
- package/locale-data/und.d.ts +1 -0
- package/locale-data/und.js +7 -0
- package/package.json +3 -3
- package/polyfill.iife.js +61 -152
- package/polyfill.js +1 -1
- package/should-polyfill.d.ts +1 -1
- package/should-polyfill.d.ts.map +1 -1
- package/should-polyfill.js +7 -2
- package/supported-locales.d.ts +2 -0
- package/supported-locales.d.ts.map +1 -0
- package/supported-locales.js +5 -0
- package/locale-data/iw.js +0 -12
- package/locale-data/ji.js +0 -9
package/abstract/GetOperands.js
CHANGED
|
@@ -7,9 +7,9 @@ var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
|
7
7
|
* @param s
|
|
8
8
|
*/
|
|
9
9
|
function GetOperands(s) {
|
|
10
|
-
ecma402_abstract_1.invariant(typeof s === 'string', "GetOperands should have been called with a string");
|
|
11
|
-
var n = ecma402_abstract_1.ToNumber(s);
|
|
12
|
-
ecma402_abstract_1.invariant(isFinite(n), 'n should be finite');
|
|
10
|
+
(0, ecma402_abstract_1.invariant)(typeof s === 'string', "GetOperands should have been called with a string");
|
|
11
|
+
var n = (0, ecma402_abstract_1.ToNumber)(s);
|
|
12
|
+
(0, ecma402_abstract_1.invariant)(isFinite(n), 'n should be finite');
|
|
13
13
|
var dp = s.indexOf('.');
|
|
14
14
|
var iv;
|
|
15
15
|
var f;
|
|
@@ -23,16 +23,16 @@ function GetOperands(s) {
|
|
|
23
23
|
else {
|
|
24
24
|
iv = s.slice(0, dp);
|
|
25
25
|
fv = s.slice(dp, s.length);
|
|
26
|
-
f = ecma402_abstract_1.ToNumber(fv);
|
|
26
|
+
f = (0, ecma402_abstract_1.ToNumber)(fv);
|
|
27
27
|
v = fv.length;
|
|
28
28
|
}
|
|
29
|
-
var i = Math.abs(ecma402_abstract_1.ToNumber(iv));
|
|
29
|
+
var i = Math.abs((0, ecma402_abstract_1.ToNumber)(iv));
|
|
30
30
|
var w;
|
|
31
31
|
var t;
|
|
32
32
|
if (f !== 0) {
|
|
33
33
|
var ft = fv.replace(/0+$/, '');
|
|
34
34
|
w = ft.length;
|
|
35
|
-
t = ecma402_abstract_1.ToNumber(ft);
|
|
35
|
+
t = (0, ecma402_abstract_1.ToNumber)(ft);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
38
|
w = 0;
|
|
@@ -5,16 +5,16 @@ var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
|
5
5
|
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
6
6
|
function InitializePluralRules(pl, locales, options, _a) {
|
|
7
7
|
var availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale, getInternalSlots = _a.getInternalSlots;
|
|
8
|
-
var requestedLocales = ecma402_abstract_1.CanonicalizeLocaleList(locales);
|
|
8
|
+
var requestedLocales = (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales);
|
|
9
9
|
var opt = Object.create(null);
|
|
10
|
-
var opts = ecma402_abstract_1.CoerceOptionsToObject(options);
|
|
10
|
+
var opts = (0, ecma402_abstract_1.CoerceOptionsToObject)(options);
|
|
11
11
|
var internalSlots = getInternalSlots(pl);
|
|
12
12
|
internalSlots.initializedPluralRules = true;
|
|
13
|
-
var matcher = ecma402_abstract_1.GetOption(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');
|
|
13
|
+
var matcher = (0, ecma402_abstract_1.GetOption)(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');
|
|
14
14
|
opt.localeMatcher = matcher;
|
|
15
|
-
internalSlots.type = ecma402_abstract_1.GetOption(opts, 'type', 'string', ['cardinal', 'ordinal'], 'cardinal');
|
|
16
|
-
ecma402_abstract_1.SetNumberFormatDigitOptions(internalSlots, opts, 0, 3, 'standard');
|
|
17
|
-
var r = intl_localematcher_1.ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
|
|
15
|
+
internalSlots.type = (0, ecma402_abstract_1.GetOption)(opts, 'type', 'string', ['cardinal', 'ordinal'], 'cardinal');
|
|
16
|
+
(0, ecma402_abstract_1.SetNumberFormatDigitOptions)(internalSlots, opts, 0, 3, 'standard');
|
|
17
|
+
var r = (0, intl_localematcher_1.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
|
|
18
18
|
internalSlots.locale = r.locale;
|
|
19
19
|
return pl;
|
|
20
20
|
}
|
|
@@ -12,16 +12,16 @@ var GetOperands_1 = require("./GetOperands");
|
|
|
12
12
|
function ResolvePlural(pl, n, _a) {
|
|
13
13
|
var getInternalSlots = _a.getInternalSlots, PluralRuleSelect = _a.PluralRuleSelect;
|
|
14
14
|
var internalSlots = getInternalSlots(pl);
|
|
15
|
-
ecma402_abstract_1.invariant(ecma402_abstract_1.Type(internalSlots) === 'Object', 'pl has to be an object');
|
|
16
|
-
ecma402_abstract_1.invariant('initializedPluralRules' in internalSlots, 'pluralrules must be initialized');
|
|
17
|
-
ecma402_abstract_1.invariant(ecma402_abstract_1.Type(n) === 'Number', 'n must be a number');
|
|
15
|
+
(0, ecma402_abstract_1.invariant)((0, ecma402_abstract_1.Type)(internalSlots) === 'Object', 'pl has to be an object');
|
|
16
|
+
(0, ecma402_abstract_1.invariant)('initializedPluralRules' in internalSlots, 'pluralrules must be initialized');
|
|
17
|
+
(0, ecma402_abstract_1.invariant)((0, ecma402_abstract_1.Type)(n) === 'Number', 'n must be a number');
|
|
18
18
|
if (!isFinite(n)) {
|
|
19
19
|
return 'other';
|
|
20
20
|
}
|
|
21
21
|
var locale = internalSlots.locale, type = internalSlots.type;
|
|
22
|
-
var res = ecma402_abstract_1.FormatNumericToString(internalSlots, n);
|
|
22
|
+
var res = (0, ecma402_abstract_1.FormatNumericToString)(internalSlots, n);
|
|
23
23
|
var s = res.formattedString;
|
|
24
|
-
var operands = GetOperands_1.GetOperands(s);
|
|
24
|
+
var operands = (0, GetOperands_1.GetOperands)(s);
|
|
25
25
|
return PluralRuleSelect(locale, type, n, operands);
|
|
26
26
|
}
|
|
27
27
|
exports.ResolvePlural = ResolvePlural;
|
package/index.js
CHANGED
|
@@ -5,10 +5,10 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
6
6
|
var InitializePluralRules_1 = require("./abstract/InitializePluralRules");
|
|
7
7
|
var ResolvePlural_1 = require("./abstract/ResolvePlural");
|
|
8
|
-
var get_internal_slots_1 = tslib_1.__importDefault(require("./get_internal_slots"));
|
|
8
|
+
var get_internal_slots_1 = (0, tslib_1.__importDefault)(require("./get_internal_slots"));
|
|
9
9
|
function validateInstance(instance, method) {
|
|
10
10
|
if (!(instance instanceof PluralRules)) {
|
|
11
|
-
throw new TypeError("Method Intl.PluralRules.prototype."
|
|
11
|
+
throw new TypeError("Method Intl.PluralRules.prototype.".concat(method, " called on incompatible receiver ").concat(String(instance)));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -21,7 +21,7 @@ function validateInstance(instance, method) {
|
|
|
21
21
|
function PluralRuleSelect(locale, type, _n, _a) {
|
|
22
22
|
var IntegerDigits = _a.IntegerDigits, NumberOfFractionDigits = _a.NumberOfFractionDigits, FractionDigits = _a.FractionDigits;
|
|
23
23
|
return PluralRules.localeData[locale].fn(NumberOfFractionDigits
|
|
24
|
-
? IntegerDigits
|
|
24
|
+
? "".concat(IntegerDigits, ".").concat(FractionDigits)
|
|
25
25
|
: IntegerDigits, type === 'ordinal');
|
|
26
26
|
}
|
|
27
27
|
var PluralRules = /** @class */ (function () {
|
|
@@ -32,7 +32,7 @@ var PluralRules = /** @class */ (function () {
|
|
|
32
32
|
if (!newTarget) {
|
|
33
33
|
throw new TypeError("Intl.PluralRules must be called with 'new'");
|
|
34
34
|
}
|
|
35
|
-
return InitializePluralRules_1.InitializePluralRules(this, locales, options, {
|
|
35
|
+
return (0, InitializePluralRules_1.InitializePluralRules)(this, locales, options, {
|
|
36
36
|
availableLocales: PluralRules.availableLocales,
|
|
37
37
|
relevantExtensionKeys: PluralRules.relevantExtensionKeys,
|
|
38
38
|
localeData: PluralRules.localeData,
|
|
@@ -43,7 +43,7 @@ var PluralRules = /** @class */ (function () {
|
|
|
43
43
|
PluralRules.prototype.resolvedOptions = function () {
|
|
44
44
|
validateInstance(this, 'resolvedOptions');
|
|
45
45
|
var opts = Object.create(null);
|
|
46
|
-
var internalSlots = get_internal_slots_1.default(this);
|
|
46
|
+
var internalSlots = (0, get_internal_slots_1.default)(this);
|
|
47
47
|
opts.locale = internalSlots.locale;
|
|
48
48
|
opts.type = internalSlots.type;
|
|
49
49
|
[
|
|
@@ -58,20 +58,20 @@ var PluralRules = /** @class */ (function () {
|
|
|
58
58
|
opts[field] = val;
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
opts.pluralCategories = tslib_1.__spreadArray([], PluralRules.localeData[opts.locale].categories[opts.type]);
|
|
61
|
+
opts.pluralCategories = (0, tslib_1.__spreadArray)([], PluralRules.localeData[opts.locale].categories[opts.type], true);
|
|
62
62
|
return opts;
|
|
63
63
|
};
|
|
64
64
|
PluralRules.prototype.select = function (val) {
|
|
65
65
|
var pr = this;
|
|
66
66
|
validateInstance(pr, 'select');
|
|
67
|
-
var n = ecma402_abstract_1.ToNumber(val);
|
|
68
|
-
return ResolvePlural_1.ResolvePlural(pr, n, { getInternalSlots: get_internal_slots_1.default, PluralRuleSelect: PluralRuleSelect });
|
|
67
|
+
var n = (0, ecma402_abstract_1.ToNumber)(val);
|
|
68
|
+
return (0, ResolvePlural_1.ResolvePlural)(pr, n, { getInternalSlots: get_internal_slots_1.default, PluralRuleSelect: PluralRuleSelect });
|
|
69
69
|
};
|
|
70
70
|
PluralRules.prototype.toString = function () {
|
|
71
71
|
return '[object Intl.PluralRules]';
|
|
72
72
|
};
|
|
73
73
|
PluralRules.supportedLocalesOf = function (locales, options) {
|
|
74
|
-
return ecma402_abstract_1.SupportedLocales(PluralRules.availableLocales, ecma402_abstract_1.CanonicalizeLocaleList(locales), options);
|
|
74
|
+
return (0, ecma402_abstract_1.SupportedLocales)(PluralRules.availableLocales, (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales), options);
|
|
75
75
|
};
|
|
76
76
|
PluralRules.__addLocaleData = function () {
|
|
77
77
|
var data = [];
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ResolvePlural } from './abstract/ResolvePlural';
|
|
|
5
5
|
import getInternalSlots from './get_internal_slots';
|
|
6
6
|
function validateInstance(instance, method) {
|
|
7
7
|
if (!(instance instanceof PluralRules)) {
|
|
8
|
-
throw new TypeError("Method Intl.PluralRules.prototype."
|
|
8
|
+
throw new TypeError("Method Intl.PluralRules.prototype.".concat(method, " called on incompatible receiver ").concat(String(instance)));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -18,7 +18,7 @@ function validateInstance(instance, method) {
|
|
|
18
18
|
function PluralRuleSelect(locale, type, _n, _a) {
|
|
19
19
|
var IntegerDigits = _a.IntegerDigits, NumberOfFractionDigits = _a.NumberOfFractionDigits, FractionDigits = _a.FractionDigits;
|
|
20
20
|
return PluralRules.localeData[locale].fn(NumberOfFractionDigits
|
|
21
|
-
? IntegerDigits
|
|
21
|
+
? "".concat(IntegerDigits, ".").concat(FractionDigits)
|
|
22
22
|
: IntegerDigits, type === 'ordinal');
|
|
23
23
|
}
|
|
24
24
|
var PluralRules = /** @class */ (function () {
|
|
@@ -55,7 +55,7 @@ var PluralRules = /** @class */ (function () {
|
|
|
55
55
|
opts[field] = val;
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
opts.pluralCategories = __spreadArray([], PluralRules.localeData[opts.locale].categories[opts.type]);
|
|
58
|
+
opts.pluralCategories = __spreadArray([], PluralRules.localeData[opts.locale].categories[opts.type], true);
|
|
59
59
|
return opts;
|
|
60
60
|
};
|
|
61
61
|
PluralRules.prototype.select = function (val) {
|
package/lib/should-polyfill.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function shouldPolyfill(locale?: string |
|
|
1
|
+
export declare function shouldPolyfill(locale?: string): string | undefined;
|
|
2
2
|
//# sourceMappingURL=should-polyfill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,MAAM,SAAO,sBAS3C"}
|
package/lib/should-polyfill.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { match } from '@formatjs/intl-localematcher';
|
|
2
|
+
import { supportedLocales } from './supported-locales';
|
|
1
3
|
function supportedLocalesOf(locale) {
|
|
2
4
|
if (!locale) {
|
|
3
5
|
return true;
|
|
@@ -6,8 +8,11 @@ function supportedLocalesOf(locale) {
|
|
|
6
8
|
return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
|
|
7
9
|
}
|
|
8
10
|
export function shouldPolyfill(locale) {
|
|
9
|
-
|
|
11
|
+
if (locale === void 0) { locale = 'en'; }
|
|
12
|
+
if (!('PluralRules' in Intl) ||
|
|
10
13
|
new Intl.PluralRules('en', { minimumFractionDigits: 2 }).select(1) ===
|
|
11
14
|
'one' ||
|
|
12
|
-
!supportedLocalesOf(locale))
|
|
15
|
+
!supportedLocalesOf(locale)) {
|
|
16
|
+
return locale ? match([locale], supportedLocales, 'en') : undefined;
|
|
17
|
+
}
|
|
13
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported-locales.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-pluralrules/supported-locales.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAAqoC,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// This file is generated from supported-locales-gen.ts
|
|
2
|
+
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"];
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["one","other"]},"fn":function(n, ord) {
|
|
5
|
+
return n == 1 ? 'one' : 'other';
|
|
6
|
+
}},"locale":"bal"})
|
|
7
|
+
}
|
package/locale-data/es.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/* @generated */
|
|
2
2
|
// prettier-ignore
|
|
3
3
|
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
-
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
+
var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
|
|
5
6
|
if (ord) return 'other';
|
|
6
|
-
return n == 1 ? 'one'
|
|
7
|
+
return n == 1 ? 'one'
|
|
8
|
+
: e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
|
|
9
|
+
: 'other';
|
|
7
10
|
}},"locale":"es"})
|
|
8
11
|
}
|
|
File without changes
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
4
|
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
5
|
return 'other';
|
|
6
|
-
}},"locale":"
|
|
6
|
+
}},"locale":"hnj"})
|
|
7
7
|
}
|
package/locale-data/it.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* @generated */
|
|
2
2
|
// prettier-ignore
|
|
3
3
|
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
-
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["many","other"]},"fn":function(n, ord) {
|
|
5
|
-
var
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["many","other"]},"fn":function(n, ord) {
|
|
5
|
+
var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
|
|
6
6
|
if (ord) return (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
|
|
7
|
-
return n == 1 && v0 ? 'one'
|
|
7
|
+
return n == 1 && v0 ? 'one'
|
|
8
|
+
: e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
|
|
9
|
+
: 'other';
|
|
8
10
|
}},"locale":"it"})
|
|
9
11
|
}
|
package/locale-data/pt-PT.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* @generated */
|
|
2
2
|
// prettier-ignore
|
|
3
3
|
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
-
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
-
var
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
+
var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
|
|
6
6
|
if (ord) return 'other';
|
|
7
|
-
return n == 1 && v0 ? 'one'
|
|
7
|
+
return n == 1 && v0 ? 'one'
|
|
8
|
+
: e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
|
|
9
|
+
: 'other';
|
|
8
10
|
}},"locale":"pt-PT"})
|
|
9
11
|
}
|
package/locale-data/pt.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* @generated */
|
|
2
2
|
// prettier-ignore
|
|
3
3
|
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
-
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
-
var
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
+
var _n = String(n), se = _n.split(/[ce]/), e = se[1] || 0, c = e, s = String(e ? Number(se[0]) * Math.pow(10, e) : _n).split("."), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
|
|
6
6
|
if (ord) return 'other';
|
|
7
|
-
return (i == 0 || i == 1) ? 'one'
|
|
7
|
+
return (i == 0 || i == 1) ? 'one'
|
|
8
|
+
: e == 0 && i != 0 && i1000000 == 0 && v0 || (e < 0 || e > 5) ? 'many'
|
|
9
|
+
: 'other';
|
|
8
10
|
}},"locale":"pt"})
|
|
9
11
|
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
+
return 'other';
|
|
6
|
+
}},"locale":"tpi"})
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* @generated */
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
+
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
+
return 'other';
|
|
6
|
+
}},"locale":"und"})
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-pluralrules",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Polyfill for Intl.PluralRules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polyfill",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"url": "git+https://github.com/formatjs/formatjs.git"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@formatjs/ecma402-abstract": "1.
|
|
24
|
-
"@formatjs/intl-localematcher": "0.2.
|
|
23
|
+
"@formatjs/ecma402-abstract": "1.11.1",
|
|
24
|
+
"@formatjs/intl-localematcher": "0.2.22",
|
|
25
25
|
"tslib": "^2.1.0"
|
|
26
26
|
},
|
|
27
27
|
"bugs": {
|
package/polyfill.iife.js
CHANGED
|
@@ -8,27 +8,24 @@
|
|
|
8
8
|
var __markAsModule = function(target) {
|
|
9
9
|
return __defProp(target, "__esModule", { value: true });
|
|
10
10
|
};
|
|
11
|
-
var __require = typeof require !== "undefined" ? require : function(x) {
|
|
12
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
};
|
|
14
11
|
var __commonJS = function(cb, mod) {
|
|
15
|
-
return function
|
|
16
|
-
return mod || (0, cb[
|
|
12
|
+
return function __require() {
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
14
|
};
|
|
18
15
|
};
|
|
19
|
-
var __reExport = function(target, module, desc) {
|
|
16
|
+
var __reExport = function(target, module, copyDefault, desc) {
|
|
20
17
|
if (module && typeof module === "object" || typeof module === "function")
|
|
21
18
|
for (var keys = __getOwnPropNames(module), i = 0, n = keys.length, key; i < n; i++) {
|
|
22
19
|
key = keys[i];
|
|
23
|
-
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
20
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
24
21
|
__defProp(target, key, { get: function(k) {
|
|
25
22
|
return module[k];
|
|
26
23
|
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
27
24
|
}
|
|
28
25
|
return target;
|
|
29
26
|
};
|
|
30
|
-
var
|
|
31
|
-
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default",
|
|
27
|
+
var __toESM = function(module, isNodeMode) {
|
|
28
|
+
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", !isNodeMode && module && module.__esModule ? { get: function() {
|
|
32
29
|
return module.default;
|
|
33
30
|
}, enumerable: true } : { value: module, enumerable: true })), module);
|
|
34
31
|
};
|
|
@@ -91,7 +88,7 @@
|
|
|
91
88
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
92
89
|
var locale = requestedLocales_1[_i];
|
|
93
90
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
94
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
91
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
95
92
|
if (availableLocale) {
|
|
96
93
|
result.locale = availableLocale;
|
|
97
94
|
if (locale !== noExtensionLocale) {
|
|
@@ -116,11 +113,11 @@
|
|
|
116
113
|
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
117
114
|
var utils_1 = require_utils();
|
|
118
115
|
function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
119
|
-
var minimizedAvailableLocaleMap =
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
}
|
|
123
|
-
var minimizedAvailableLocales = new Set();
|
|
116
|
+
var minimizedAvailableLocaleMap = {};
|
|
117
|
+
availableLocales.forEach(function(l2) {
|
|
118
|
+
return minimizedAvailableLocaleMap[l2] = l2;
|
|
119
|
+
});
|
|
120
|
+
var minimizedAvailableLocales = /* @__PURE__ */ new Set();
|
|
124
121
|
availableLocales.forEach(function(locale2) {
|
|
125
122
|
var minimizedLocale = new Intl.Locale(locale2).minimize().toString();
|
|
126
123
|
minimizedAvailableLocaleMap[minimizedLocale] = locale2;
|
|
@@ -148,7 +145,7 @@
|
|
|
148
145
|
foundLocale = minimizedRequestedLocale;
|
|
149
146
|
break;
|
|
150
147
|
}
|
|
151
|
-
foundLocale = BestAvailableLocale_1.BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
148
|
+
foundLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
152
149
|
}
|
|
153
150
|
return {
|
|
154
151
|
locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
|
|
@@ -166,9 +163,9 @@
|
|
|
166
163
|
exports.UnicodeExtensionValue = void 0;
|
|
167
164
|
var utils_1 = require_utils();
|
|
168
165
|
function UnicodeExtensionValue(extension, key) {
|
|
169
|
-
utils_1.invariant(key.length === 2, "key must have 2 elements");
|
|
166
|
+
(0, utils_1.invariant)(key.length === 2, "key must have 2 elements");
|
|
170
167
|
var size = extension.length;
|
|
171
|
-
var searchValue = "-"
|
|
168
|
+
var searchValue = "-".concat(key, "-");
|
|
172
169
|
var pos = extension.indexOf(searchValue);
|
|
173
170
|
if (pos !== -1) {
|
|
174
171
|
var start = pos + 4;
|
|
@@ -195,7 +192,7 @@
|
|
|
195
192
|
}
|
|
196
193
|
return extension.slice(start, end);
|
|
197
194
|
}
|
|
198
|
-
searchValue = "-"
|
|
195
|
+
searchValue = "-".concat(key);
|
|
199
196
|
pos = extension.indexOf(searchValue);
|
|
200
197
|
if (pos !== -1 && pos + 3 === size) {
|
|
201
198
|
return "";
|
|
@@ -216,44 +213,44 @@
|
|
|
216
213
|
var BestFitMatcher_1 = require_BestFitMatcher();
|
|
217
214
|
var utils_1 = require_utils();
|
|
218
215
|
var UnicodeExtensionValue_1 = require_UnicodeExtensionValue();
|
|
219
|
-
function
|
|
216
|
+
function ResolveLocale2(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
|
|
220
217
|
var matcher = options.localeMatcher;
|
|
221
218
|
var r;
|
|
222
219
|
if (matcher === "lookup") {
|
|
223
|
-
r = LookupMatcher_1.LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
220
|
+
r = (0, LookupMatcher_1.LookupMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
224
221
|
} else {
|
|
225
|
-
r = BestFitMatcher_1.BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
222
|
+
r = (0, BestFitMatcher_1.BestFitMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
226
223
|
}
|
|
227
224
|
var foundLocale = r.locale;
|
|
228
225
|
var result = { locale: "", dataLocale: foundLocale };
|
|
229
226
|
var supportedExtension = "-u";
|
|
230
227
|
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
231
228
|
var key = relevantExtensionKeys_1[_i];
|
|
232
|
-
utils_1.invariant(foundLocale in localeData, "Missing locale data for "
|
|
229
|
+
(0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
|
|
233
230
|
var foundLocaleData = localeData[foundLocale];
|
|
234
|
-
utils_1.invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data "
|
|
231
|
+
(0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
|
|
235
232
|
var keyLocaleData = foundLocaleData[key];
|
|
236
|
-
utils_1.invariant(Array.isArray(keyLocaleData), "keyLocaleData for "
|
|
233
|
+
(0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
|
|
237
234
|
var value = keyLocaleData[0];
|
|
238
|
-
utils_1.invariant(typeof value === "string" || value === null, "value must be string or null but got "
|
|
235
|
+
(0, utils_1.invariant)(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
|
|
239
236
|
var supportedExtensionAddition = "";
|
|
240
237
|
if (r.extension) {
|
|
241
|
-
var requestedValue = UnicodeExtensionValue_1.UnicodeExtensionValue(r.extension, key);
|
|
238
|
+
var requestedValue = (0, UnicodeExtensionValue_1.UnicodeExtensionValue)(r.extension, key);
|
|
242
239
|
if (requestedValue !== void 0) {
|
|
243
240
|
if (requestedValue !== "") {
|
|
244
241
|
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
245
242
|
value = requestedValue;
|
|
246
|
-
supportedExtensionAddition = "-"
|
|
243
|
+
supportedExtensionAddition = "-".concat(key, "-").concat(value);
|
|
247
244
|
}
|
|
248
245
|
} else if (~requestedValue.indexOf("true")) {
|
|
249
246
|
value = "true";
|
|
250
|
-
supportedExtensionAddition = "-"
|
|
247
|
+
supportedExtensionAddition = "-".concat(key);
|
|
251
248
|
}
|
|
252
249
|
}
|
|
253
250
|
}
|
|
254
251
|
if (key in options) {
|
|
255
252
|
var optionsValue = options[key];
|
|
256
|
-
utils_1.invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
253
|
+
(0, utils_1.invariant)(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
257
254
|
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
258
255
|
if (optionsValue !== value) {
|
|
259
256
|
value = optionsValue;
|
|
@@ -278,7 +275,7 @@
|
|
|
278
275
|
result.locale = foundLocale;
|
|
279
276
|
return result;
|
|
280
277
|
}
|
|
281
|
-
exports.ResolveLocale =
|
|
278
|
+
exports.ResolveLocale = ResolveLocale2;
|
|
282
279
|
}
|
|
283
280
|
});
|
|
284
281
|
|
|
@@ -295,7 +292,7 @@
|
|
|
295
292
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
296
293
|
var locale = requestedLocales_1[_i];
|
|
297
294
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
298
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
295
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
299
296
|
if (availableLocale) {
|
|
300
297
|
subset.push(availableLocale);
|
|
301
298
|
}
|
|
@@ -313,18 +310,18 @@
|
|
|
313
310
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
314
311
|
exports.ResolveLocale = exports.LookupSupportedLocales = exports.match = void 0;
|
|
315
312
|
var ResolveLocale_1 = require_ResolveLocale();
|
|
316
|
-
function
|
|
313
|
+
function match2(requestedLocales, availableLocales, defaultLocale, opts) {
|
|
317
314
|
var locales = availableLocales.reduce(function(all, l) {
|
|
318
315
|
all.add(l);
|
|
319
316
|
return all;
|
|
320
|
-
}, new Set());
|
|
321
|
-
return ResolveLocale_1.ResolveLocale(locales, requestedLocales, {
|
|
317
|
+
}, /* @__PURE__ */ new Set());
|
|
318
|
+
return (0, ResolveLocale_1.ResolveLocale)(locales, requestedLocales, {
|
|
322
319
|
localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
|
|
323
320
|
}, [], {}, function() {
|
|
324
321
|
return defaultLocale;
|
|
325
322
|
}).locale;
|
|
326
323
|
}
|
|
327
|
-
exports.match =
|
|
324
|
+
exports.match = match2;
|
|
328
325
|
var LookupSupportedLocales_1 = require_LookupSupportedLocales();
|
|
329
326
|
Object.defineProperty(exports, "LookupSupportedLocales", { enumerable: true, get: function() {
|
|
330
327
|
return LookupSupportedLocales_1.LookupSupportedLocales;
|
|
@@ -337,25 +334,6 @@
|
|
|
337
334
|
});
|
|
338
335
|
|
|
339
336
|
// node_modules/tslib/tslib.es6.js
|
|
340
|
-
var extendStatics = function(d, b) {
|
|
341
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
342
|
-
d2.__proto__ = b2;
|
|
343
|
-
} || function(d2, b2) {
|
|
344
|
-
for (var p in b2)
|
|
345
|
-
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
346
|
-
d2[p] = b2[p];
|
|
347
|
-
};
|
|
348
|
-
return extendStatics(d, b);
|
|
349
|
-
};
|
|
350
|
-
function __extends(d, b) {
|
|
351
|
-
if (typeof b !== "function" && b !== null)
|
|
352
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
353
|
-
extendStatics(d, b);
|
|
354
|
-
function __() {
|
|
355
|
-
this.constructor = d;
|
|
356
|
-
}
|
|
357
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
358
|
-
}
|
|
359
337
|
function __spreadArray(to, from, pack) {
|
|
360
338
|
if (pack || arguments.length === 2)
|
|
361
339
|
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
@@ -365,7 +343,7 @@
|
|
|
365
343
|
ar[i] = from[i];
|
|
366
344
|
}
|
|
367
345
|
}
|
|
368
|
-
return to.concat(ar || from);
|
|
346
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
369
347
|
}
|
|
370
348
|
|
|
371
349
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/CanonicalizeLocaleList.js
|
|
@@ -458,7 +436,7 @@
|
|
|
458
436
|
if (val !== void 0) {
|
|
459
437
|
val = Number(val);
|
|
460
438
|
if (isNaN(val) || val < min || val > max) {
|
|
461
|
-
throw new RangeError(val
|
|
439
|
+
throw new RangeError("".concat(val, " is outside of range [").concat(min, ", ").concat(max, "]"));
|
|
462
440
|
}
|
|
463
441
|
return Math.floor(val);
|
|
464
442
|
}
|
|
@@ -490,64 +468,13 @@
|
|
|
490
468
|
if (values !== void 0 && !values.filter(function(val) {
|
|
491
469
|
return val == value;
|
|
492
470
|
}).length) {
|
|
493
|
-
throw new RangeError(value
|
|
471
|
+
throw new RangeError("".concat(value, " is not within ").concat(values.join(", ")));
|
|
494
472
|
}
|
|
495
473
|
return value;
|
|
496
474
|
}
|
|
497
475
|
return fallback;
|
|
498
476
|
}
|
|
499
477
|
|
|
500
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/IsSanctionedSimpleUnitIdentifier.js
|
|
501
|
-
var SANCTIONED_UNITS = [
|
|
502
|
-
"angle-degree",
|
|
503
|
-
"area-acre",
|
|
504
|
-
"area-hectare",
|
|
505
|
-
"concentr-percent",
|
|
506
|
-
"digital-bit",
|
|
507
|
-
"digital-byte",
|
|
508
|
-
"digital-gigabit",
|
|
509
|
-
"digital-gigabyte",
|
|
510
|
-
"digital-kilobit",
|
|
511
|
-
"digital-kilobyte",
|
|
512
|
-
"digital-megabit",
|
|
513
|
-
"digital-megabyte",
|
|
514
|
-
"digital-petabyte",
|
|
515
|
-
"digital-terabit",
|
|
516
|
-
"digital-terabyte",
|
|
517
|
-
"duration-day",
|
|
518
|
-
"duration-hour",
|
|
519
|
-
"duration-millisecond",
|
|
520
|
-
"duration-minute",
|
|
521
|
-
"duration-month",
|
|
522
|
-
"duration-second",
|
|
523
|
-
"duration-week",
|
|
524
|
-
"duration-year",
|
|
525
|
-
"length-centimeter",
|
|
526
|
-
"length-foot",
|
|
527
|
-
"length-inch",
|
|
528
|
-
"length-kilometer",
|
|
529
|
-
"length-meter",
|
|
530
|
-
"length-mile-scandinavian",
|
|
531
|
-
"length-mile",
|
|
532
|
-
"length-millimeter",
|
|
533
|
-
"length-yard",
|
|
534
|
-
"mass-gram",
|
|
535
|
-
"mass-kilogram",
|
|
536
|
-
"mass-ounce",
|
|
537
|
-
"mass-pound",
|
|
538
|
-
"mass-stone",
|
|
539
|
-
"temperature-celsius",
|
|
540
|
-
"temperature-fahrenheit",
|
|
541
|
-
"volume-fluid-ounce",
|
|
542
|
-
"volume-gallon",
|
|
543
|
-
"volume-liter",
|
|
544
|
-
"volume-milliliter"
|
|
545
|
-
];
|
|
546
|
-
function removeUnitNamespace(unit) {
|
|
547
|
-
return unit.slice(unit.indexOf("-") + 1);
|
|
548
|
-
}
|
|
549
|
-
var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
|
|
550
|
-
|
|
551
478
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/utils.js
|
|
552
479
|
function getMagnitude(x) {
|
|
553
480
|
return Math.floor(Math.log(x) * Math.LOG10E);
|
|
@@ -607,10 +534,10 @@
|
|
|
607
534
|
m = m + repeat("0", e - p + 1);
|
|
608
535
|
int = e + 1;
|
|
609
536
|
} else if (e >= 0) {
|
|
610
|
-
m = m.slice(0, e + 1)
|
|
537
|
+
m = "".concat(m.slice(0, e + 1), ".").concat(m.slice(e + 1));
|
|
611
538
|
int = e + 1;
|
|
612
539
|
} else {
|
|
613
|
-
m = "0."
|
|
540
|
+
m = "0.".concat(repeat("0", -e - 1)).concat(m);
|
|
614
541
|
int = 1;
|
|
615
542
|
}
|
|
616
543
|
if (m.indexOf(".") >= 0 && maxPrecision > minPrecision) {
|
|
@@ -653,7 +580,7 @@
|
|
|
653
580
|
}
|
|
654
581
|
var a = m.slice(0, k - f);
|
|
655
582
|
var b = m.slice(k - f);
|
|
656
|
-
m = a
|
|
583
|
+
m = "".concat(a, ".").concat(b);
|
|
657
584
|
int = a.length;
|
|
658
585
|
} else {
|
|
659
586
|
int = m.length;
|
|
@@ -705,16 +632,6 @@
|
|
|
705
632
|
return { roundedNumber: x, formattedString: string };
|
|
706
633
|
}
|
|
707
634
|
|
|
708
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/regex.generated.js
|
|
709
|
-
var S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
|
|
710
|
-
|
|
711
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/format_to_parts.js
|
|
712
|
-
var CARET_S_UNICODE_REGEX = new RegExp("^" + S_UNICODE_REGEX.source);
|
|
713
|
-
var S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source + "$");
|
|
714
|
-
|
|
715
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
|
|
716
|
-
var import_intl_localematcher = __toModule(require_intl_localematcher());
|
|
717
|
-
|
|
718
635
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/SetNumberFormatDigitOptions.js
|
|
719
636
|
function SetNumberFormatDigitOptions(internalSlots, opts, mnfdDefault, mxfdDefault, notation) {
|
|
720
637
|
var mnid = GetNumberOption(opts, "minimumIntegerDigits", 1, 21, 1);
|
|
@@ -746,7 +663,7 @@
|
|
|
746
663
|
}
|
|
747
664
|
|
|
748
665
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/SupportedLocales.js
|
|
749
|
-
var
|
|
666
|
+
var import_intl_localematcher = __toESM(require_intl_localematcher());
|
|
750
667
|
function SupportedLocales(availableLocales, requestedLocales, options) {
|
|
751
668
|
var matcher = "best fit";
|
|
752
669
|
if (options !== void 0) {
|
|
@@ -754,32 +671,13 @@
|
|
|
754
671
|
matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
|
|
755
672
|
}
|
|
756
673
|
if (matcher === "best fit") {
|
|
757
|
-
return (0,
|
|
674
|
+
return (0, import_intl_localematcher.LookupSupportedLocales)(availableLocales, requestedLocales);
|
|
758
675
|
}
|
|
759
|
-
return (0,
|
|
676
|
+
return (0, import_intl_localematcher.LookupSupportedLocales)(availableLocales, requestedLocales);
|
|
760
677
|
}
|
|
761
678
|
|
|
762
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/data.js
|
|
763
|
-
var MissingLocaleDataError = function(_super) {
|
|
764
|
-
__extends(MissingLocaleDataError2, _super);
|
|
765
|
-
function MissingLocaleDataError2() {
|
|
766
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
767
|
-
_this.type = "MISSING_LOCALE_DATA";
|
|
768
|
-
return _this;
|
|
769
|
-
}
|
|
770
|
-
return MissingLocaleDataError2;
|
|
771
|
-
}(Error);
|
|
772
|
-
|
|
773
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/types/date-time.js
|
|
774
|
-
var RangePatternType;
|
|
775
|
-
(function(RangePatternType2) {
|
|
776
|
-
RangePatternType2["startRange"] = "startRange";
|
|
777
|
-
RangePatternType2["shared"] = "shared";
|
|
778
|
-
RangePatternType2["endRange"] = "endRange";
|
|
779
|
-
})(RangePatternType || (RangePatternType = {}));
|
|
780
|
-
|
|
781
679
|
// bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/abstract/InitializePluralRules.js
|
|
782
|
-
var
|
|
680
|
+
var import_intl_localematcher2 = __toESM(require_intl_localematcher());
|
|
783
681
|
function InitializePluralRules(pl, locales, options, _a) {
|
|
784
682
|
var availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale, getInternalSlots2 = _a.getInternalSlots;
|
|
785
683
|
var requestedLocales = CanonicalizeLocaleList(locales);
|
|
@@ -791,7 +689,7 @@
|
|
|
791
689
|
opt.localeMatcher = matcher;
|
|
792
690
|
internalSlots.type = GetOption(opts, "type", "string", ["cardinal", "ordinal"], "cardinal");
|
|
793
691
|
SetNumberFormatDigitOptions(internalSlots, opts, 0, 3, "standard");
|
|
794
|
-
var r = (0,
|
|
692
|
+
var r = (0, import_intl_localematcher2.ResolveLocale)(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
|
|
795
693
|
internalSlots.locale = r.locale;
|
|
796
694
|
return pl;
|
|
797
695
|
}
|
|
@@ -855,7 +753,7 @@
|
|
|
855
753
|
}
|
|
856
754
|
|
|
857
755
|
// bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/get_internal_slots.js
|
|
858
|
-
var internalSlotMap = new WeakMap();
|
|
756
|
+
var internalSlotMap = /* @__PURE__ */ new WeakMap();
|
|
859
757
|
function getInternalSlots(x) {
|
|
860
758
|
var internalSlots = internalSlotMap.get(x);
|
|
861
759
|
if (!internalSlots) {
|
|
@@ -868,12 +766,12 @@
|
|
|
868
766
|
// bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/index.js
|
|
869
767
|
function validateInstance(instance, method) {
|
|
870
768
|
if (!(instance instanceof PluralRules)) {
|
|
871
|
-
throw new TypeError("Method Intl.PluralRules.prototype."
|
|
769
|
+
throw new TypeError("Method Intl.PluralRules.prototype.".concat(method, " called on incompatible receiver ").concat(String(instance)));
|
|
872
770
|
}
|
|
873
771
|
}
|
|
874
772
|
function PluralRuleSelect(locale, type, _n, _a) {
|
|
875
773
|
var IntegerDigits = _a.IntegerDigits, NumberOfFractionDigits = _a.NumberOfFractionDigits, FractionDigits = _a.FractionDigits;
|
|
876
|
-
return PluralRules.localeData[locale].fn(NumberOfFractionDigits ? IntegerDigits
|
|
774
|
+
return PluralRules.localeData[locale].fn(NumberOfFractionDigits ? "".concat(IntegerDigits, ".").concat(FractionDigits) : IntegerDigits, type === "ordinal");
|
|
877
775
|
}
|
|
878
776
|
var PluralRules = function() {
|
|
879
777
|
function PluralRules2(locales, options) {
|
|
@@ -907,7 +805,7 @@
|
|
|
907
805
|
opts[field] = val;
|
|
908
806
|
}
|
|
909
807
|
});
|
|
910
|
-
opts.pluralCategories = __spreadArray([], PluralRules2.localeData[opts.locale].categories[opts.type]);
|
|
808
|
+
opts.pluralCategories = __spreadArray([], PluralRules2.localeData[opts.locale].categories[opts.type], true);
|
|
911
809
|
return opts;
|
|
912
810
|
};
|
|
913
811
|
PluralRules2.prototype.select = function(val) {
|
|
@@ -940,7 +838,7 @@
|
|
|
940
838
|
return PluralRules2.__defaultLocale;
|
|
941
839
|
};
|
|
942
840
|
PluralRules2.localeData = {};
|
|
943
|
-
PluralRules2.availableLocales = new Set();
|
|
841
|
+
PluralRules2.availableLocales = /* @__PURE__ */ new Set();
|
|
944
842
|
PluralRules2.__defaultLocale = "";
|
|
945
843
|
PluralRules2.relevantExtensionKeys = [];
|
|
946
844
|
PluralRules2.polyfilled = true;
|
|
@@ -979,6 +877,12 @@
|
|
|
979
877
|
} catch (ex) {
|
|
980
878
|
}
|
|
981
879
|
|
|
880
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/should-polyfill.js
|
|
881
|
+
var import_intl_localematcher3 = __toESM(require_intl_localematcher());
|
|
882
|
+
|
|
883
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/supported-locales.js
|
|
884
|
+
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"];
|
|
885
|
+
|
|
982
886
|
// bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/should-polyfill.js
|
|
983
887
|
function supportedLocalesOf(locale) {
|
|
984
888
|
if (!locale) {
|
|
@@ -988,7 +892,12 @@
|
|
|
988
892
|
return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
|
|
989
893
|
}
|
|
990
894
|
function shouldPolyfill(locale) {
|
|
991
|
-
|
|
895
|
+
if (locale === void 0) {
|
|
896
|
+
locale = "en";
|
|
897
|
+
}
|
|
898
|
+
if (!("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale)) {
|
|
899
|
+
return locale ? (0, import_intl_localematcher3.match)([locale], supportedLocales, "en") : void 0;
|
|
900
|
+
}
|
|
992
901
|
}
|
|
993
902
|
|
|
994
903
|
// bazel-out/darwin-fastbuild/bin/packages/intl-pluralrules/lib/polyfill.js
|
package/polyfill.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var _1 = require("./");
|
|
4
4
|
var should_polyfill_1 = require("./should-polyfill");
|
|
5
|
-
if (should_polyfill_1.shouldPolyfill()) {
|
|
5
|
+
if ((0, should_polyfill_1.shouldPolyfill)()) {
|
|
6
6
|
Object.defineProperty(Intl, 'PluralRules', {
|
|
7
7
|
value: _1.PluralRules,
|
|
8
8
|
writable: true,
|
package/should-polyfill.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function shouldPolyfill(locale?: string |
|
|
1
|
+
export declare function shouldPolyfill(locale?: string): string | undefined;
|
|
2
2
|
//# sourceMappingURL=should-polyfill.d.ts.map
|
package/should-polyfill.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-pluralrules/should-polyfill.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,MAAM,SAAO,sBAS3C"}
|
package/should-polyfill.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.shouldPolyfill = void 0;
|
|
4
|
+
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
5
|
+
var supported_locales_1 = require("./supported-locales");
|
|
4
6
|
function supportedLocalesOf(locale) {
|
|
5
7
|
if (!locale) {
|
|
6
8
|
return true;
|
|
@@ -9,9 +11,12 @@ function supportedLocalesOf(locale) {
|
|
|
9
11
|
return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
|
|
10
12
|
}
|
|
11
13
|
function shouldPolyfill(locale) {
|
|
12
|
-
|
|
14
|
+
if (locale === void 0) { locale = 'en'; }
|
|
15
|
+
if (!('PluralRules' in Intl) ||
|
|
13
16
|
new Intl.PluralRules('en', { minimumFractionDigits: 2 }).select(1) ===
|
|
14
17
|
'one' ||
|
|
15
|
-
!supportedLocalesOf(locale))
|
|
18
|
+
!supportedLocalesOf(locale)) {
|
|
19
|
+
return locale ? (0, intl_localematcher_1.match)([locale], supported_locales_1.supportedLocales, 'en') : undefined;
|
|
20
|
+
}
|
|
16
21
|
}
|
|
17
22
|
exports.shouldPolyfill = shouldPolyfill;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported-locales.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-pluralrules/supported-locales.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAAqoC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supportedLocales = void 0;
|
|
4
|
+
// This file is generated from supported-locales-gen.ts
|
|
5
|
+
exports.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"];
|
package/locale-data/iw.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* @generated */
|
|
2
|
-
// prettier-ignore
|
|
3
|
-
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
|
-
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["one","two","many","other"],"ordinal":["other"]},"fn":function(n, ord) {
|
|
5
|
-
var s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1);
|
|
6
|
-
if (ord) return 'other';
|
|
7
|
-
return n == 1 && v0 ? 'one'
|
|
8
|
-
: i == 2 && v0 ? 'two'
|
|
9
|
-
: v0 && (n < 0 || n > 10) && t0 && n10 == 0 ? 'many'
|
|
10
|
-
: 'other';
|
|
11
|
-
}},"locale":"iw"})
|
|
12
|
-
}
|
package/locale-data/ji.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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(n, ord) {
|
|
5
|
-
var s = String(n).split('.'), v0 = !s[1];
|
|
6
|
-
if (ord) return 'other';
|
|
7
|
-
return n == 1 && v0 ? 'one' : 'other';
|
|
8
|
-
}},"locale":"ji"})
|
|
9
|
-
}
|