@formatjs/intl-pluralrules 7.0.1 → 7.0.3

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 +8 -2
  2. package/polyfill.iife.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-pluralrules",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "Polyfill for Intl.PluralRules",
5
5
  "keywords": [
6
6
  "PluralRules",
@@ -19,6 +19,12 @@
19
19
  "url": "formatjs/formatjs.git"
20
20
  },
21
21
  "type": "module",
22
+ "sideEffects": [
23
+ "./polyfill.js",
24
+ "./polyfill-force.js",
25
+ "./polyfill.iife.js",
26
+ "./locale-data/*.js"
27
+ ],
22
28
  "types": "index.d.ts",
23
29
  "exports": {
24
30
  ".": "./index.js",
@@ -29,7 +35,7 @@
29
35
  "./should-polyfill.js": "./should-polyfill.js"
30
36
  },
31
37
  "dependencies": {
32
- "@formatjs/bigdecimal": "0.2.9",
38
+ "@formatjs/bigdecimal": "0.2.10",
33
39
  "@formatjs/intl-localematcher": "0.10.1"
34
40
  }
35
41
  }
package/polyfill.iife.js CHANGED
@@ -3218,7 +3218,10 @@ var BigDecimal = class BigDecimal {
3218
3218
  const negZero = this._isSignNegative() !== other._isSignNegative();
3219
3219
  return BigDecimal._create(0n, 0, 0, negZero);
3220
3220
  }
3221
- const [nm, ne] = removeTrailingZeros(this._mantissa * bigintPow10(DIV_PRECISION) / other._mantissa, this._exponent - other._exponent - DIV_PRECISION);
3221
+ const exponent = this._exponent - other._exponent;
3222
+ const newExponent = exponent - DIV_PRECISION;
3223
+ if ((other._mantissa === 1n || other._mantissa === -1n) && Number.isSafeInteger(exponent) && Number.isSafeInteger(newExponent)) return BigDecimal._create(other._mantissa === 1n ? this._mantissa : -this._mantissa, exponent === 0 ? 0 : exponent, 0, false);
3224
+ const [nm, ne] = removeTrailingZeros(this._mantissa * bigintPow10(DIV_PRECISION) / other._mantissa, newExponent);
3222
3225
  return BigDecimal._create(nm, ne, 0, false);
3223
3226
  }
3224
3227
  plus(y) {