@formatjs/intl-numberformat 9.1.2 → 9.2.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/package.json +8 -8
- package/polyfill.iife.js +8 -7
- package/src/core.d.ts +0 -1
- package/src/currency-digits.generated.js +1 -1
- package/src/get_internal_slots.d.ts +0 -1
- package/src/types.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-numberformat",
|
|
3
3
|
"description": "Ponyfill for ES2020 Intl.NumberFormat",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.2.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "index.d.ts",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"./locale-data/*": "./locale-data/*"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"decimal.js": "^10.
|
|
17
|
-
"tslib": "^2.8.
|
|
18
|
-
"@formatjs/ecma402-abstract": "3.0
|
|
19
|
-
"@formatjs/intl-localematcher": "0.
|
|
16
|
+
"decimal.js": "^10.6.0",
|
|
17
|
+
"tslib": "^2.8.1",
|
|
18
|
+
"@formatjs/ecma402-abstract": "3.1.0",
|
|
19
|
+
"@formatjs/intl-localematcher": "0.8.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@formatjs/intl-getcanonicallocales": "3.
|
|
23
|
-
"@formatjs/intl-
|
|
24
|
-
"@formatjs/intl-
|
|
22
|
+
"@formatjs/intl-getcanonicallocales": "3.2.0",
|
|
23
|
+
"@formatjs/intl-locale": "5.2.0",
|
|
24
|
+
"@formatjs/intl-pluralrules": "6.2.0"
|
|
25
25
|
},
|
|
26
26
|
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
27
27
|
"contributors": [
|
package/polyfill.iife.js
CHANGED
|
@@ -2471,7 +2471,6 @@
|
|
|
2471
2471
|
}
|
|
2472
2472
|
}
|
|
2473
2473
|
var createMemoizedNumberFormat = memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
|
|
2474
|
-
var createMemoizedDateTimeFormat = memoize((...args) => new Intl.DateTimeFormat(...args), { strategy: strategies.variadic });
|
|
2475
2474
|
var createMemoizedPluralRules = memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
|
|
2476
2475
|
var createMemoizedLocale = memoize((...args) => new Intl.Locale(...args), { strategy: strategies.variadic });
|
|
2477
2476
|
var createMemoizedListFormat = memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
|
|
@@ -2730,8 +2729,10 @@
|
|
|
2730
2729
|
|
|
2731
2730
|
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/NumberFormat/ApplyUnsignedRoundingMode.js
|
|
2732
2731
|
function ApplyUnsignedRoundingMode(x, r1, r2, unsignedRoundingMode) {
|
|
2733
|
-
if (x.eq(r1))
|
|
2732
|
+
if (x.eq(r1) || r1.eq(r2))
|
|
2734
2733
|
return r1;
|
|
2734
|
+
if (x.eq(r2))
|
|
2735
|
+
return r2;
|
|
2735
2736
|
invariant(r1.lessThan(x) && x.lessThan(r2), `x should be between r1 and r2 but x=${x}, r1=${r1}, r2=${r2}`);
|
|
2736
2737
|
if (unsignedRoundingMode === "zero") {
|
|
2737
2738
|
return r1;
|
|
@@ -3228,7 +3229,7 @@
|
|
|
3228
3229
|
}
|
|
3229
3230
|
|
|
3230
3231
|
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/regex.generated.js
|
|
3231
|
-
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-\
|
|
3232
|
+
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\u0888\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-\u20C1\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-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\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-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\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]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\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-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/;
|
|
3232
3233
|
|
|
3233
3234
|
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/NumberFormat/digit-mapping.generated.js
|
|
3234
3235
|
var digitMapping = {
|
|
@@ -8461,10 +8462,10 @@ Valid values are ${Array.from(VALID_ROUNDING_INCREMENTS).join(", ")}.`);
|
|
|
8461
8462
|
|
|
8462
8463
|
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/ToIntlMathematicalValue.js
|
|
8463
8464
|
function ToIntlMathematicalValue(input) {
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
return new Decimal(primValue);
|
|
8465
|
+
if (typeof input === "bigint") {
|
|
8466
|
+
return new Decimal(input.toString());
|
|
8467
8467
|
}
|
|
8468
|
+
let primValue = ToPrimitive(input, "number");
|
|
8468
8469
|
if (primValue === void 0) {
|
|
8469
8470
|
return new Decimal(NaN);
|
|
8470
8471
|
}
|
|
@@ -8533,7 +8534,7 @@ Valid values are ${Array.from(VALID_ROUNDING_INCREMENTS).join(", ")}.`);
|
|
|
8533
8534
|
OMR: 3,
|
|
8534
8535
|
PKR: 0,
|
|
8535
8536
|
PYG: 0,
|
|
8536
|
-
RSD:
|
|
8537
|
+
RSD: 2,
|
|
8537
8538
|
RWF: 0,
|
|
8538
8539
|
SEK: 2,
|
|
8539
8540
|
SLE: 2,
|
package/src/core.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type NumberFormatConstructor, type NumberFormat as NumberFormatType } from "./types.js";
|
|
2
|
-
// Merge declaration with the constructor defined below.
|
|
3
2
|
export type NumberFormat = NumberFormatType;
|
|
4
3
|
/**
|
|
5
4
|
* https://tc39.es/ecma402/#sec-intl-numberformat-constructor
|
package/src/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type NumberFormatLocaleInternalData, type NumberFormatOptions, type NumberFormatPart, type NumberRangeToParts, type RawNumberLocaleData, type ResolvedNumberFormatOptions } from "@formatjs/ecma402-abstract";
|
|
2
2
|
import type Decimal from "decimal.js";
|
|
3
|
-
// Public --------------------------------------------------------------------------------------------------------------
|
|
4
3
|
export interface NumberFormat {
|
|
5
4
|
resolvedOptions(): ResolvedNumberFormatOptions;
|
|
6
5
|
formatToParts(x: number | bigint | Decimal | string): NumberFormatPart[];
|