@formatjs/intl-pluralrules 5.4.3 → 5.4.5

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.
Files changed (2) hide show
  1. package/package.json +20 -25
  2. package/polyfill.iife.js +34 -22
package/package.json CHANGED
@@ -1,36 +1,31 @@
1
1
  {
2
2
  "name": "@formatjs/intl-pluralrules",
3
- "version": "5.4.3",
4
3
  "description": "Polyfill for Intl.PluralRules",
4
+ "version": "5.4.5",
5
+ "author": "Long Ho <holevietlong@gmail.com>",
6
+ "bugs": "https://github.com/formatjs/formatjs/issues",
7
+ "dependencies": {
8
+ "@formatjs/ecma402-abstract": "2.3.5",
9
+ "@formatjs/intl-localematcher": "0.6.2",
10
+ "decimal.js": "^10.4.3",
11
+ "tslib": "^2.8.0"
12
+ },
13
+ "devDependencies": {
14
+ "@formatjs/intl-getcanonicallocales": "2.5.6",
15
+ "@formatjs/intl-locale": "4.2.12"
16
+ },
17
+ "gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
18
+ "homepage": "https://github.com/formatjs/formatjs",
5
19
  "keywords": [
6
- "polyfill",
7
20
  "i18n",
8
21
  "intl",
9
22
  "plural",
10
- "rules",
11
- "PluralRules"
23
+ "PluralRules",
24
+ "polyfill",
25
+ "rules"
12
26
  ],
13
- "author": "Long Ho <holevietlong@gmail.com>",
14
- "homepage": "https://github.com/formatjs/formatjs",
15
27
  "license": "MIT",
16
28
  "main": "index.js",
17
- "types": "index.d.ts",
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/formatjs/formatjs.git"
21
- },
22
- "dependencies": {
23
- "decimal.js": "10",
24
- "tslib": "2",
25
- "@formatjs/ecma402-abstract": "2.3.3",
26
- "@formatjs/intl-localematcher": "0.6.0"
27
- },
28
- "devDependencies": {
29
- "@formatjs/intl-getcanonicallocales": "2.5.4",
30
- "@formatjs/intl-locale": "4.2.10"
31
- },
32
- "bugs": {
33
- "url": "https://github.com/formatjs/formatjs/issues"
34
- },
35
- "gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c"
29
+ "repository": "formatjs/formatjs.git",
30
+ "types": "index.d.ts"
36
31
  }
package/polyfill.iife.js CHANGED
@@ -11,7 +11,7 @@
11
11
  return Intl.getCanonicalLocales(locales);
12
12
  }
13
13
 
14
- // node_modules/.aspect_rules_js/decimal.js@10.4.3/node_modules/decimal.js/decimal.mjs
14
+ // node_modules/.aspect_rules_js/decimal.js@10.6.0/node_modules/decimal.js/decimal.mjs
15
15
  var EXP_LIMIT = 9e15;
16
16
  var MAX_DIGITS = 1e9;
17
17
  var NUMERALS = "0123456789abcdef";
@@ -303,7 +303,7 @@
303
303
  return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);
304
304
  };
305
305
  P.inverseCosine = P.acos = function() {
306
- var halfPi, x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding;
306
+ var x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding;
307
307
  if (k !== -1) {
308
308
  return k === 0 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN);
309
309
  }
@@ -311,11 +311,10 @@
311
311
  return getPi(Ctor, pr + 4, rm).times(0.5);
312
312
  Ctor.precision = pr + 6;
313
313
  Ctor.rounding = 1;
314
- x = x.asin();
315
- halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
314
+ x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().atan();
316
315
  Ctor.precision = pr;
317
316
  Ctor.rounding = rm;
318
- return halfPi.minus(x);
317
+ return x.times(2);
319
318
  };
320
319
  P.inverseHyperbolicCosine = P.acosh = function() {
321
320
  var pr, rm, x = this, Ctor = x.constructor;
@@ -1527,14 +1526,16 @@
1527
1526
  function isOdd(n) {
1528
1527
  return n.d[n.d.length - 1] & 1;
1529
1528
  }
1530
- function maxOrMin(Ctor, args, ltgt) {
1531
- var y, x = new Ctor(args[0]), i = 0;
1529
+ function maxOrMin(Ctor, args, n) {
1530
+ var k, y, x = new Ctor(args[0]), i = 0;
1532
1531
  for (; ++i < args.length; ) {
1533
1532
  y = new Ctor(args[i]);
1534
1533
  if (!y.s) {
1535
1534
  x = y;
1536
1535
  break;
1537
- } else if (x[ltgt](y)) {
1536
+ }
1537
+ k = x.cmp(y);
1538
+ if (k === n || k === 0 && x.s === n) {
1538
1539
  x = y;
1539
1540
  }
1540
1541
  }
@@ -2116,7 +2117,8 @@
2116
2117
  x.d = [v];
2117
2118
  }
2118
2119
  return;
2119
- } else if (v * 0 !== 0) {
2120
+ }
2121
+ if (v * 0 !== 0) {
2120
2122
  if (!v)
2121
2123
  x.s = NaN;
2122
2124
  x.e = NaN;
@@ -2124,18 +2126,28 @@
2124
2126
  return;
2125
2127
  }
2126
2128
  return parseDecimal(x, v.toString());
2127
- } else if (t !== "string") {
2128
- throw Error(invalidArgument + v);
2129
2129
  }
2130
- if ((i2 = v.charCodeAt(0)) === 45) {
2131
- v = v.slice(1);
2132
- x.s = -1;
2133
- } else {
2134
- if (i2 === 43)
2130
+ if (t === "string") {
2131
+ if ((i2 = v.charCodeAt(0)) === 45) {
2135
2132
  v = v.slice(1);
2136
- x.s = 1;
2133
+ x.s = -1;
2134
+ } else {
2135
+ if (i2 === 43)
2136
+ v = v.slice(1);
2137
+ x.s = 1;
2138
+ }
2139
+ return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
2140
+ }
2141
+ if (t === "bigint") {
2142
+ if (v < 0) {
2143
+ v = -v;
2144
+ x.s = -1;
2145
+ } else {
2146
+ x.s = 1;
2147
+ }
2148
+ return parseDecimal(x, v.toString());
2137
2149
  }
2138
- return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
2150
+ throw Error(invalidArgument + v);
2139
2151
  }
2140
2152
  Decimal2.prototype = P;
2141
2153
  Decimal2.ROUND_UP = 0;
@@ -2245,10 +2257,10 @@
2245
2257
  return new this(x).log(10);
2246
2258
  }
2247
2259
  function max() {
2248
- return maxOrMin(this, arguments, "lt");
2260
+ return maxOrMin(this, arguments, -1);
2249
2261
  }
2250
2262
  function min() {
2251
- return maxOrMin(this, arguments, "gt");
2263
+ return maxOrMin(this, arguments, 1);
2252
2264
  }
2253
2265
  function mod(x, y) {
2254
2266
  return new this(x).mod(y);
@@ -7873,10 +7885,10 @@
7873
7885
 
7874
7886
  decimal.js/decimal.mjs:
7875
7887
  (*!
7876
- * decimal.js v10.4.3
7888
+ * decimal.js v10.6.0
7877
7889
  * An arbitrary-precision Decimal type for JavaScript.
7878
7890
  * https://github.com/MikeMcl/decimal.js
7879
- * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
7891
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
7880
7892
  * MIT Licence
7881
7893
  *)
7882
7894
  */