@formatjs/intl-numberformat 9.1.0 → 9.1.2

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.
@@ -1,77 +1,77 @@
1
- export var currencyDigitsData = {
2
- "ADP": 0,
3
- "AFN": 0,
4
- "ALL": 0,
5
- "AMD": 2,
6
- "BHD": 3,
7
- "BIF": 0,
8
- "BYN": 2,
9
- "BYR": 0,
10
- "CAD": 2,
11
- "CHF": 2,
12
- "CLF": 4,
13
- "CLP": 0,
14
- "COP": 0,
15
- "CRC": 2,
16
- "CZK": 2,
17
- "DEFAULT": 2,
18
- "DJF": 0,
19
- "DKK": 2,
20
- "ESP": 0,
21
- "GNF": 0,
22
- "GYD": 2,
23
- "HUF": 0,
24
- "IDR": 0,
25
- "IQD": 0,
26
- "IRR": 0,
27
- "ISK": 0,
28
- "ITL": 0,
29
- "JOD": 3,
30
- "JPY": 0,
31
- "KMF": 0,
32
- "KPW": 0,
33
- "KRW": 0,
34
- "KWD": 3,
35
- "LAK": 0,
36
- "LBP": 0,
37
- "LUF": 0,
38
- "LYD": 3,
39
- "MGA": 0,
40
- "MGF": 0,
41
- "MMK": 0,
42
- "MNT": 2,
43
- "MRO": 0,
44
- "MUR": 2,
45
- "NOK": 2,
46
- "OMR": 3,
47
- "PKR": 0,
48
- "PYG": 0,
49
- "RSD": 0,
50
- "RWF": 0,
51
- "SEK": 2,
52
- "SLE": 2,
53
- "SLL": 0,
54
- "SOS": 0,
55
- "STD": 0,
56
- "SYP": 0,
57
- "TMM": 0,
58
- "TND": 3,
59
- "TRL": 0,
60
- "TWD": 2,
61
- "TZS": 2,
62
- "UGX": 0,
63
- "UYI": 0,
64
- "UYW": 4,
65
- "UZS": 2,
66
- "VEF": 2,
67
- "VND": 0,
68
- "VUV": 0,
69
- "XAD": 2,
70
- "XAF": 0,
71
- "XAU": 2,
72
- "XOF": 0,
73
- "XPF": 0,
74
- "YER": 0,
75
- "ZMK": 0,
76
- "ZWD": 0
1
+ export const currencyDigitsData = {
2
+ ADP: 0,
3
+ AFN: 0,
4
+ ALL: 0,
5
+ AMD: 2,
6
+ BHD: 3,
7
+ BIF: 0,
8
+ BYN: 2,
9
+ BYR: 0,
10
+ CAD: 2,
11
+ CHF: 2,
12
+ CLF: 4,
13
+ CLP: 0,
14
+ COP: 0,
15
+ CRC: 2,
16
+ CZK: 2,
17
+ DEFAULT: 2,
18
+ DJF: 0,
19
+ DKK: 2,
20
+ ESP: 0,
21
+ GNF: 0,
22
+ GYD: 2,
23
+ HUF: 0,
24
+ IDR: 0,
25
+ IQD: 0,
26
+ IRR: 0,
27
+ ISK: 0,
28
+ ITL: 0,
29
+ JOD: 3,
30
+ JPY: 0,
31
+ KMF: 0,
32
+ KPW: 0,
33
+ KRW: 0,
34
+ KWD: 3,
35
+ LAK: 0,
36
+ LBP: 0,
37
+ LUF: 0,
38
+ LYD: 3,
39
+ MGA: 0,
40
+ MGF: 0,
41
+ MMK: 0,
42
+ MNT: 2,
43
+ MRO: 0,
44
+ MUR: 2,
45
+ NOK: 2,
46
+ OMR: 3,
47
+ PKR: 0,
48
+ PYG: 0,
49
+ RSD: 0,
50
+ RWF: 0,
51
+ SEK: 2,
52
+ SLE: 2,
53
+ SLL: 0,
54
+ SOS: 0,
55
+ STD: 0,
56
+ SYP: 0,
57
+ TMM: 0,
58
+ TND: 3,
59
+ TRL: 0,
60
+ TWD: 2,
61
+ TZS: 2,
62
+ UGX: 0,
63
+ UYI: 0,
64
+ UYW: 4,
65
+ UZS: 2,
66
+ VEF: 2,
67
+ VND: 0,
68
+ VUV: 0,
69
+ XAD: 2,
70
+ XAF: 0,
71
+ XAU: 2,
72
+ XOF: 0,
73
+ XPF: 0,
74
+ YER: 0,
75
+ ZMK: 0,
76
+ ZWD: 0
77
77
  };
@@ -1,2 +1,3 @@
1
- import { NumberFormatInternal } from '@formatjs/ecma402-abstract';
1
+ // Type-only circular import
2
+ import { type NumberFormatInternal } from "@formatjs/ecma402-abstract";
2
3
  export default function getInternalSlots(x: Intl.NumberFormat): NumberFormatInternal;
@@ -1,10 +1,11 @@
1
1
  // Type-only circular import
2
- var internalSlotMap = new WeakMap();
2
+ import "@formatjs/ecma402-abstract";
3
+ const internalSlotMap = new WeakMap();
3
4
  export default function getInternalSlots(x) {
4
- var internalSlots = internalSlotMap.get(x);
5
- if (!internalSlots) {
6
- internalSlots = Object.create(null);
7
- internalSlotMap.set(x, internalSlots);
8
- }
9
- return internalSlots;
5
+ let internalSlots = internalSlotMap.get(x);
6
+ if (!internalSlots) {
7
+ internalSlots = Object.create(null);
8
+ internalSlotMap.set(x, internalSlots);
9
+ }
10
+ return internalSlots;
10
11
  }
@@ -1 +1,99 @@
1
- export var numberingSystemNames = ["adlm", "ahom", "arab", "arabext", "armn", "armnlow", "bali", "beng", "bhks", "brah", "cakm", "cham", "cyrl", "deva", "diak", "ethi", "fullwide", "gara", "geor", "gong", "gonm", "grek", "greklow", "gujr", "gukh", "guru", "hanidays", "hanidec", "hans", "hansfin", "hant", "hantfin", "hebr", "hmng", "hmnp", "java", "jpan", "jpanfin", "jpanyear", "kali", "kawi", "khmr", "knda", "krai", "lana", "lanatham", "laoo", "latn", "lepc", "limb", "mathbold", "mathdbl", "mathmono", "mathsanb", "mathsans", "mlym", "modi", "mong", "mroo", "mtei", "mymr", "mymrepka", "mymrpao", "mymrshan", "mymrtlng", "nagm", "newa", "nkoo", "olck", "onao", "orya", "osma", "outlined", "rohg", "roman", "romanlow", "saur", "segment", "shrd", "sind", "sinh", "sora", "sund", "sunu", "takr", "talu", "taml", "tamldec", "telu", "thai", "tibt", "tirh", "tnsa", "tols", "vaii", "wara", "wcho"];
1
+ export const numberingSystemNames = [
2
+ "adlm",
3
+ "ahom",
4
+ "arab",
5
+ "arabext",
6
+ "armn",
7
+ "armnlow",
8
+ "bali",
9
+ "beng",
10
+ "bhks",
11
+ "brah",
12
+ "cakm",
13
+ "cham",
14
+ "cyrl",
15
+ "deva",
16
+ "diak",
17
+ "ethi",
18
+ "fullwide",
19
+ "gara",
20
+ "geor",
21
+ "gong",
22
+ "gonm",
23
+ "grek",
24
+ "greklow",
25
+ "gujr",
26
+ "gukh",
27
+ "guru",
28
+ "hanidays",
29
+ "hanidec",
30
+ "hans",
31
+ "hansfin",
32
+ "hant",
33
+ "hantfin",
34
+ "hebr",
35
+ "hmng",
36
+ "hmnp",
37
+ "java",
38
+ "jpan",
39
+ "jpanfin",
40
+ "jpanyear",
41
+ "kali",
42
+ "kawi",
43
+ "khmr",
44
+ "knda",
45
+ "krai",
46
+ "lana",
47
+ "lanatham",
48
+ "laoo",
49
+ "latn",
50
+ "lepc",
51
+ "limb",
52
+ "mathbold",
53
+ "mathdbl",
54
+ "mathmono",
55
+ "mathsanb",
56
+ "mathsans",
57
+ "mlym",
58
+ "modi",
59
+ "mong",
60
+ "mroo",
61
+ "mtei",
62
+ "mymr",
63
+ "mymrepka",
64
+ "mymrpao",
65
+ "mymrshan",
66
+ "mymrtlng",
67
+ "nagm",
68
+ "newa",
69
+ "nkoo",
70
+ "olck",
71
+ "onao",
72
+ "orya",
73
+ "osma",
74
+ "outlined",
75
+ "rohg",
76
+ "roman",
77
+ "romanlow",
78
+ "saur",
79
+ "segment",
80
+ "shrd",
81
+ "sind",
82
+ "sinh",
83
+ "sora",
84
+ "sund",
85
+ "sunu",
86
+ "takr",
87
+ "talu",
88
+ "taml",
89
+ "tamldec",
90
+ "telu",
91
+ "thai",
92
+ "tibt",
93
+ "tirh",
94
+ "tnsa",
95
+ "tols",
96
+ "vaii",
97
+ "wara",
98
+ "wcho"
99
+ ];
@@ -1,6 +1,6 @@
1
- import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
1
+ import { type NumberFormatOptions } from "@formatjs/ecma402-abstract";
2
2
  /**
3
- * Number.prototype.toLocaleString ponyfill
4
- * https://tc39.es/ecma402/#sup-number.prototype.tolocalestring
5
- */
3
+ * Number.prototype.toLocaleString ponyfill
4
+ * https://tc39.es/ecma402/#sup-number.prototype.tolocalestring
5
+ */
6
6
  export declare function toLocaleString(x: number, locales?: string | string[], options?: NumberFormatOptions): string;
@@ -1,10 +1,11 @@
1
1
  // eslint-disable-next-line import/no-cycle
2
- import { NumberFormat } from './core.js';
2
+ import { NumberFormat } from "./core.js";
3
+ import "@formatjs/ecma402-abstract";
3
4
  /**
4
- * Number.prototype.toLocaleString ponyfill
5
- * https://tc39.es/ecma402/#sup-number.prototype.tolocalestring
6
- */
5
+ * Number.prototype.toLocaleString ponyfill
6
+ * https://tc39.es/ecma402/#sup-number.prototype.tolocalestring
7
+ */
7
8
  export function toLocaleString(x, locales, options) {
8
- var numberFormat = new NumberFormat(locales, options);
9
- return numberFormat.format(x);
9
+ const numberFormat = new NumberFormat(locales, options);
10
+ return numberFormat.format(x);
10
11
  }
package/src/types.d.ts CHANGED
@@ -1,21 +1,22 @@
1
- import { NumberFormatLocaleInternalData, NumberFormatOptions, NumberFormatPart, NumberRangeToParts, RawNumberLocaleData, ResolvedNumberFormatOptions } from '@formatjs/ecma402-abstract';
2
- import Decimal from 'decimal.js';
1
+ import { type NumberFormatLocaleInternalData, type NumberFormatOptions, type NumberFormatPart, type NumberRangeToParts, type RawNumberLocaleData, type ResolvedNumberFormatOptions } from "@formatjs/ecma402-abstract";
2
+ import type Decimal from "decimal.js";
3
+ // Public --------------------------------------------------------------------------------------------------------------
3
4
  export interface NumberFormat {
4
- resolvedOptions(): ResolvedNumberFormatOptions;
5
- formatToParts(x: number | bigint | Decimal | string): NumberFormatPart[];
6
- format(x: number | bigint | Decimal | string): string;
7
- formatRange(start: number | bigint | Decimal | string, end: number | bigint | Decimal | string): string;
8
- formatRangeToParts(start: number | bigint | Decimal | string, end: number | bigint | Decimal | string): NumberRangeToParts[];
5
+ resolvedOptions(): ResolvedNumberFormatOptions;
6
+ formatToParts(x: number | bigint | Decimal | string): NumberFormatPart[];
7
+ format(x: number | bigint | Decimal | string): string;
8
+ formatRange(start: number | bigint | Decimal | string, end: number | bigint | Decimal | string): string;
9
+ formatRangeToParts(start: number | bigint | Decimal | string, end: number | bigint | Decimal | string): NumberRangeToParts[];
9
10
  }
10
11
  export interface NumberFormatConstructor {
11
- new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
12
- (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
13
- __addLocaleData(...data: RawNumberLocaleData[]): void;
14
- __addUnitData(locale: string, unitsData: RawNumberLocaleData['data']['units']): void;
15
- supportedLocalesOf(locales: string | string[], options?: Pick<NumberFormatOptions, 'localeMatcher'>): string[];
16
- getDefaultLocale(): string;
17
- __defaultLocale: string;
18
- localeData: Record<string, NumberFormatLocaleInternalData | undefined>;
19
- availableLocales: Set<string>;
20
- polyfilled: boolean;
12
+ new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
13
+ (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
14
+ __addLocaleData(...data: RawNumberLocaleData[]): void;
15
+ __addUnitData(locale: string, unitsData: RawNumberLocaleData["data"]["units"]): void;
16
+ supportedLocalesOf(locales: string | string[], options?: Pick<NumberFormatOptions, "localeMatcher">): string[];
17
+ getDefaultLocale(): string;
18
+ __defaultLocale: string;
19
+ localeData: Record<string, NumberFormatLocaleInternalData | undefined>;
20
+ availableLocales: Set<string>;
21
+ polyfilled: boolean;
21
22
  }
package/src/types.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import "@formatjs/ecma402-abstract";