@formatjs/intl-enumerator 1.8.9 → 1.8.10

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 +14 -19
  2. package/polyfill.iife.js +34 -22
package/package.json CHANGED
@@ -1,30 +1,25 @@
1
1
  {
2
2
  "name": "@formatjs/intl-enumerator",
3
- "version": "1.8.9",
4
3
  "description": "Intl.Enumerator polyfill",
4
+ "version": "1.8.10",
5
+ "license": "MIT",
6
+ "author": "Michele Riva <ciao@micheleriva.it>",
7
+ "types": "index.d.ts",
8
+ "dependencies": {
9
+ "tslib": "^2.8.0",
10
+ "@formatjs/ecma402-abstract": "2.3.4"
11
+ },
12
+ "bugs": "https://github.com/formatjs/formatjs/issues",
13
+ "homepage": "https://github.com/formatjs/formatjs#readme",
5
14
  "keywords": [
6
- "intl",
15
+ "ecma402",
7
16
  "enumerator",
8
17
  "formatjs",
9
- "react-intl",
10
18
  "i18n",
11
- "ecma402",
19
+ "intl",
20
+ "react-intl",
12
21
  "tc39"
13
22
  ],
14
- "author": "Michele Riva <ciao@micheleriva.it>",
15
- "homepage": "https://github.com/formatjs/formatjs#readme",
16
- "license": "MIT",
17
23
  "main": "index.js",
18
- "types": "index.d.ts",
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/formatjs/formatjs.git"
22
- },
23
- "bugs": {
24
- "url": "https://github.com/formatjs/formatjs/issues"
25
- },
26
- "dependencies": {
27
- "tslib": "2",
28
- "@formatjs/ecma402-abstract": "2.3.3"
29
- }
24
+ "repository": "formatjs/formatjs.git"
30
25
  }
package/polyfill.iife.js CHANGED
@@ -4,7 +4,7 @@
4
4
  return !("supportedValuesOf" in Intl);
5
5
  }
6
6
 
7
- // node_modules/.aspect_rules_js/decimal.js@10.4.3/node_modules/decimal.js/decimal.mjs
7
+ // node_modules/.aspect_rules_js/decimal.js@10.5.0/node_modules/decimal.js/decimal.mjs
8
8
  var EXP_LIMIT = 9e15;
9
9
  var MAX_DIGITS = 1e9;
10
10
  var NUMERALS = "0123456789abcdef";
@@ -296,7 +296,7 @@
296
296
  return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);
297
297
  };
298
298
  P.inverseCosine = P.acos = function() {
299
- var halfPi, x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding;
299
+ var x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding;
300
300
  if (k !== -1) {
301
301
  return k === 0 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN);
302
302
  }
@@ -304,11 +304,10 @@
304
304
  return getPi(Ctor, pr + 4, rm).times(0.5);
305
305
  Ctor.precision = pr + 6;
306
306
  Ctor.rounding = 1;
307
- x = x.asin();
308
- halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
307
+ x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().atan();
309
308
  Ctor.precision = pr;
310
309
  Ctor.rounding = rm;
311
- return halfPi.minus(x);
310
+ return x.times(2);
312
311
  };
313
312
  P.inverseHyperbolicCosine = P.acosh = function() {
314
313
  var pr, rm, x = this, Ctor = x.constructor;
@@ -1520,14 +1519,16 @@
1520
1519
  function isOdd(n) {
1521
1520
  return n.d[n.d.length - 1] & 1;
1522
1521
  }
1523
- function maxOrMin(Ctor, args, ltgt) {
1524
- var y, x = new Ctor(args[0]), i = 0;
1522
+ function maxOrMin(Ctor, args, n) {
1523
+ var k, y, x = new Ctor(args[0]), i = 0;
1525
1524
  for (; ++i < args.length; ) {
1526
1525
  y = new Ctor(args[i]);
1527
1526
  if (!y.s) {
1528
1527
  x = y;
1529
1528
  break;
1530
- } else if (x[ltgt](y)) {
1529
+ }
1530
+ k = x.cmp(y);
1531
+ if (k === n || k === 0 && x.s === n) {
1531
1532
  x = y;
1532
1533
  }
1533
1534
  }
@@ -2109,7 +2110,8 @@
2109
2110
  x.d = [v];
2110
2111
  }
2111
2112
  return;
2112
- } else if (v * 0 !== 0) {
2113
+ }
2114
+ if (v * 0 !== 0) {
2113
2115
  if (!v)
2114
2116
  x.s = NaN;
2115
2117
  x.e = NaN;
@@ -2117,18 +2119,28 @@
2117
2119
  return;
2118
2120
  }
2119
2121
  return parseDecimal(x, v.toString());
2120
- } else if (t !== "string") {
2121
- throw Error(invalidArgument + v);
2122
2122
  }
2123
- if ((i2 = v.charCodeAt(0)) === 45) {
2124
- v = v.slice(1);
2125
- x.s = -1;
2126
- } else {
2127
- if (i2 === 43)
2123
+ if (t === "string") {
2124
+ if ((i2 = v.charCodeAt(0)) === 45) {
2128
2125
  v = v.slice(1);
2129
- x.s = 1;
2126
+ x.s = -1;
2127
+ } else {
2128
+ if (i2 === 43)
2129
+ v = v.slice(1);
2130
+ x.s = 1;
2131
+ }
2132
+ return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
2133
+ }
2134
+ if (t === "bigint") {
2135
+ if (v < 0) {
2136
+ v = -v;
2137
+ x.s = -1;
2138
+ } else {
2139
+ x.s = 1;
2140
+ }
2141
+ return parseDecimal(x, v.toString());
2130
2142
  }
2131
- return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
2143
+ throw Error(invalidArgument + v);
2132
2144
  }
2133
2145
  Decimal2.prototype = P;
2134
2146
  Decimal2.ROUND_UP = 0;
@@ -2238,10 +2250,10 @@
2238
2250
  return new this(x).log(10);
2239
2251
  }
2240
2252
  function max() {
2241
- return maxOrMin(this, arguments, "lt");
2253
+ return maxOrMin(this, arguments, -1);
2242
2254
  }
2243
2255
  function min() {
2244
- return maxOrMin(this, arguments, "gt");
2256
+ return maxOrMin(this, arguments, 1);
2245
2257
  }
2246
2258
  function mod(x, y) {
2247
2259
  return new this(x).mod(y);
@@ -2778,10 +2790,10 @@
2778
2790
 
2779
2791
  decimal.js/decimal.mjs:
2780
2792
  (*!
2781
- * decimal.js v10.4.3
2793
+ * decimal.js v10.5.0
2782
2794
  * An arbitrary-precision Decimal type for JavaScript.
2783
2795
  * https://github.com/MikeMcl/decimal.js
2784
- * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
2796
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
2785
2797
  * MIT Licence
2786
2798
  *)
2787
2799
  */