@formatjs/intl 2.9.10 → 2.10.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/lib/src/number.d.ts +1 -1
- package/lib/src/number.js +6 -2
- package/package.json +8 -8
- package/src/number.d.ts +1 -1
- package/src/number.js +6 -2
package/lib/src/number.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Formatters, IntlFormatters,
|
|
1
|
+
import { CustomFormats, Formatters, IntlFormatters, OnErrorFn } from './types';
|
|
2
2
|
export declare function getFormatter({ locale, formats, onError, }: {
|
|
3
3
|
locale: string;
|
|
4
4
|
formats: CustomFormats;
|
package/lib/src/number.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { getNamedFormat, filterProps } from './utils';
|
|
2
1
|
import { IntlFormatError } from './error';
|
|
2
|
+
import { filterProps, getNamedFormat } from './utils';
|
|
3
3
|
var NUMBER_FORMAT_OPTIONS = [
|
|
4
4
|
'style',
|
|
5
5
|
'currency',
|
|
6
|
-
'currencyDisplay',
|
|
7
6
|
'unit',
|
|
8
7
|
'unitDisplay',
|
|
9
8
|
'useGrouping',
|
|
@@ -21,6 +20,11 @@ var NUMBER_FORMAT_OPTIONS = [
|
|
|
21
20
|
'unit',
|
|
22
21
|
'unitDisplay',
|
|
23
22
|
'numberingSystem',
|
|
23
|
+
// ES2023 NumberFormat
|
|
24
|
+
'trailingZeroDisplay',
|
|
25
|
+
'roundingPriority',
|
|
26
|
+
'roundingIncrement',
|
|
27
|
+
'roundingMode',
|
|
24
28
|
];
|
|
25
29
|
export function getFormatter(_a, getNumberFormat, options) {
|
|
26
30
|
var locale = _a.locale, formats = _a.formats, onError = _a.onError;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"tslib": "^2.4.0",
|
|
33
|
-
"@formatjs/icu-messageformat-parser": "2.7.
|
|
33
|
+
"@formatjs/icu-messageformat-parser": "2.7.6",
|
|
34
|
+
"@formatjs/intl-listformat": "7.5.5",
|
|
35
|
+
"@formatjs/ecma402-abstract": "1.18.2",
|
|
34
36
|
"@formatjs/fast-memoize": "2.2.0",
|
|
35
|
-
"@formatjs/intl-displaynames": "6.6.
|
|
36
|
-
"
|
|
37
|
-
"intl-messageformat": "10.5.9",
|
|
38
|
-
"@formatjs/intl-listformat": "7.5.4"
|
|
37
|
+
"@formatjs/intl-displaynames": "6.6.6",
|
|
38
|
+
"intl-messageformat": "10.5.11"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@formatjs/intl-numberformat": "8.
|
|
42
|
-
"@formatjs/intl-datetimeformat": "6.12.
|
|
41
|
+
"@formatjs/intl-numberformat": "8.10.0",
|
|
42
|
+
"@formatjs/intl-datetimeformat": "6.12.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"typescript": "^4.7 || 5"
|
package/src/number.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Formatters, IntlFormatters,
|
|
1
|
+
import { CustomFormats, Formatters, IntlFormatters, OnErrorFn } from './types';
|
|
2
2
|
export declare function getFormatter({ locale, formats, onError, }: {
|
|
3
3
|
locale: string;
|
|
4
4
|
formats: CustomFormats;
|
package/src/number.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatNumberToParts = exports.formatNumber = exports.getFormatter = void 0;
|
|
4
|
-
var utils_1 = require("./utils");
|
|
5
4
|
var error_1 = require("./error");
|
|
5
|
+
var utils_1 = require("./utils");
|
|
6
6
|
var NUMBER_FORMAT_OPTIONS = [
|
|
7
7
|
'style',
|
|
8
8
|
'currency',
|
|
9
|
-
'currencyDisplay',
|
|
10
9
|
'unit',
|
|
11
10
|
'unitDisplay',
|
|
12
11
|
'useGrouping',
|
|
@@ -24,6 +23,11 @@ var NUMBER_FORMAT_OPTIONS = [
|
|
|
24
23
|
'unit',
|
|
25
24
|
'unitDisplay',
|
|
26
25
|
'numberingSystem',
|
|
26
|
+
// ES2023 NumberFormat
|
|
27
|
+
'trailingZeroDisplay',
|
|
28
|
+
'roundingPriority',
|
|
29
|
+
'roundingIncrement',
|
|
30
|
+
'roundingMode',
|
|
27
31
|
];
|
|
28
32
|
function getFormatter(_a, getNumberFormat, options) {
|
|
29
33
|
var locale = _a.locale, formats = _a.formats, onError = _a.onError;
|