@formatjs/ecma402-abstract 3.0.7 → 3.1.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/262.d.ts +55 -55
- package/262.js +327 -327
- package/CanonicalizeLocaleList.d.ts +3 -3
- package/CanonicalizeLocaleList.js +5 -5
- package/CanonicalizeTimeZoneName.d.ts +13 -13
- package/CanonicalizeTimeZoneName.js +81 -82
- package/CoerceOptionsToObject.d.ts +4 -4
- package/CoerceOptionsToObject.js +9 -9
- package/DefaultNumberOption.d.ts +6 -6
- package/DefaultNumberOption.js +15 -15
- package/GetNumberOption.d.ts +5 -9
- package/GetNumberOption.js +10 -10
- package/GetOption.d.ts +12 -8
- package/GetOption.js +28 -28
- package/GetOptionsObject.d.ts +4 -4
- package/GetOptionsObject.js +11 -11
- package/GetStringOrBooleanOption.d.ts +4 -10
- package/GetStringOrBooleanOption.js +28 -28
- package/IsSanctionedSimpleUnitIdentifier.d.ts +6 -6
- package/IsSanctionedSimpleUnitIdentifier.js +53 -53
- package/IsValidTimeZoneName.d.ts +15 -15
- package/IsValidTimeZoneName.js +65 -66
- package/IsWellFormedCurrencyCode.d.ts +2 -2
- package/IsWellFormedCurrencyCode.js +15 -15
- package/IsWellFormedUnitIdentifier.d.ts +3 -3
- package/IsWellFormedUnitIdentifier.js +21 -22
- package/NumberFormat/ApplyUnsignedRoundingMode.d.ts +2 -2
- package/NumberFormat/ApplyUnsignedRoundingMode.js +34 -31
- package/NumberFormat/CollapseNumberRange.d.ts +6 -6
- package/NumberFormat/CollapseNumberRange.js +47 -47
- package/NumberFormat/ComputeExponent.d.ts +8 -8
- package/NumberFormat/ComputeExponent.js +48 -58
- package/NumberFormat/ComputeExponentForMagnitude.d.ts +6 -6
- package/NumberFormat/ComputeExponentForMagnitude.js +64 -72
- package/NumberFormat/CurrencyDigits.d.ts +3 -3
- package/NumberFormat/CurrencyDigits.js +5 -8
- package/NumberFormat/FormatApproximately.d.ts +3 -3
- package/NumberFormat/FormatApproximately.js +10 -6
- package/NumberFormat/FormatNumeric.d.ts +2 -2
- package/NumberFormat/FormatNumeric.js +4 -3
- package/NumberFormat/FormatNumericRange.d.ts +6 -6
- package/NumberFormat/FormatNumericRange.js +7 -9
- package/NumberFormat/FormatNumericRangeToParts.d.ts +6 -6
- package/NumberFormat/FormatNumericRangeToParts.js +12 -14
- package/NumberFormat/FormatNumericToParts.d.ts +3 -3
- package/NumberFormat/FormatNumericToParts.js +12 -12
- package/NumberFormat/FormatNumericToString.d.ts +7 -7
- package/NumberFormat/FormatNumericToString.js +79 -81
- package/NumberFormat/GetUnsignedRoundingMode.d.ts +1 -1
- package/NumberFormat/GetUnsignedRoundingMode.js +25 -24
- package/NumberFormat/InitializeNumberFormat.d.ts +10 -10
- package/NumberFormat/InitializeNumberFormat.js +83 -64
- package/NumberFormat/PartitionNumberPattern.d.ts +4 -4
- package/NumberFormat/PartitionNumberPattern.js +112 -123
- package/NumberFormat/PartitionNumberRangePattern.d.ts +6 -6
- package/NumberFormat/PartitionNumberRangePattern.js +41 -38
- package/NumberFormat/SetNumberFormatDigitOptions.d.ts +3 -3
- package/NumberFormat/SetNumberFormatDigitOptions.js +185 -174
- package/NumberFormat/SetNumberFormatUnitOptions.d.ts +3 -3
- package/NumberFormat/SetNumberFormatUnitOptions.js +62 -48
- package/NumberFormat/ToRawFixed.d.ts +7 -7
- package/NumberFormat/ToRawFixed.js +103 -107
- package/NumberFormat/ToRawPrecision.d.ts +7 -7
- package/NumberFormat/ToRawPrecision.js +199 -202
- package/NumberFormat/decimal-cache.d.ts +10 -10
- package/NumberFormat/decimal-cache.js +13 -13
- package/NumberFormat/digit-mapping.generated.js +781 -66
- package/NumberFormat/format_to_parts.d.ts +19 -20
- package/NumberFormat/format_to_parts.js +446 -438
- package/PartitionPattern.d.ts +6 -6
- package/PartitionPattern.js +33 -33
- package/SupportedLocales.d.ts +6 -6
- package/SupportedLocales.js +17 -17
- package/ToIntlMathematicalValue.d.ts +5 -1
- package/ToIntlMathematicalValue.js +31 -25
- package/constants.d.ts +1 -1
- package/constants.js +4 -4
- package/data.d.ts +1 -1
- package/data.js +4 -11
- package/index.d.ts +47 -47
- package/index.js +45 -45
- package/package.json +5 -5
- package/regex.generated.js +1 -1
- package/types/core.d.ts +5 -5
- package/types/date-time.d.ts +123 -128
- package/types/date-time.js +6 -6
- package/types/displaynames.d.ts +55 -55
- package/types/displaynames.js +1 -1
- package/types/list.d.ts +11 -11
- package/types/list.js +1 -1
- package/types/number.d.ts +137 -137
- package/types/number.js +2 -1
- package/types/plural-rules.d.ts +19 -11
- package/types/plural-rules.js +2 -1
- package/types/relative-time.d.ts +26 -32
- package/types/relative-time.js +2 -1
- package/utils.d.ts +30 -15
- package/utils.js +62 -116
package/262.d.ts
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { Decimal } from
|
|
1
|
+
import { Decimal } from "decimal.js";
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
* https://tc39.es/ecma262/#sec-tostring
|
|
4
|
+
*/
|
|
5
5
|
export declare function ToString(o: unknown): string;
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
* https://tc39.es/ecma262/#sec-tonumber
|
|
8
|
+
* @param val
|
|
9
|
+
*/
|
|
10
10
|
export declare function ToNumber(arg: any): Decimal;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* https://tc39.es/ecma262/#sec-timeclip
|
|
13
|
+
* @param time
|
|
14
|
+
*/
|
|
15
15
|
export declare function TimeClip(time: Decimal): Decimal;
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
* https://tc39.es/ecma262/#sec-toobject
|
|
18
|
+
* @param arg
|
|
19
|
+
*/
|
|
20
20
|
export declare function ToObject<T>(arg: T): T extends null ? never : T extends undefined ? never : T;
|
|
21
21
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue
|
|
23
|
+
* @param x
|
|
24
|
+
* @param y
|
|
25
|
+
*/
|
|
26
26
|
export declare function SameValue(x: any, y: any): boolean;
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate
|
|
29
|
+
* @param len
|
|
30
|
+
*/
|
|
31
31
|
export declare function ArrayCreate<T = any>(len: number): T[];
|
|
32
32
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty
|
|
34
|
+
* @param o
|
|
35
|
+
* @param prop
|
|
36
|
+
*/
|
|
37
37
|
export declare function HasOwnProperty(o: object, prop: string): boolean;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export declare function Type(x: any):
|
|
39
|
+
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
|
|
40
|
+
* @param x
|
|
41
|
+
*/
|
|
42
|
+
export declare function Type(x: any): "Null" | "Undefined" | "Object" | "Number" | "Boolean" | "String" | "Symbol" | "BigInt" | undefined;
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
* https://tc39.es/ecma262/#eqn-Day
|
|
45
|
+
* @param t
|
|
46
|
+
*/
|
|
47
47
|
export declare function Day(t: number): number;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
* https://tc39.es/ecma262/#sec-week-day
|
|
50
|
+
* @param t
|
|
51
|
+
*/
|
|
52
52
|
export declare function WeekDay(t: number): number;
|
|
53
53
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
* https://tc39.es/ecma262/#sec-year-number
|
|
55
|
+
* @param y
|
|
56
|
+
*/
|
|
57
57
|
export declare function DayFromYear(y: number): number;
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
* https://tc39.es/ecma262/#sec-year-number
|
|
60
|
+
* @param y
|
|
61
|
+
*/
|
|
62
62
|
export declare function TimeFromYear(y: number): number;
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
* https://tc39.es/ecma262/#sec-year-number
|
|
65
|
+
* @param t
|
|
66
|
+
*/
|
|
67
67
|
export declare function YearFromTime(t: number): number;
|
|
68
68
|
export declare function DaysInYear(y: number): 365 | 366;
|
|
69
69
|
export declare function DayWithinYear(t: number): number;
|
|
70
70
|
export declare function InLeapYear(t: number): 0 | 1;
|
|
71
71
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
* https://tc39.es/ecma262/#sec-month-number
|
|
73
|
+
* @param t
|
|
74
|
+
*/
|
|
75
75
|
export declare function MonthFromTime(t: number): 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
|
|
76
76
|
export declare function DateFromTime(t: number): number;
|
|
77
77
|
export declare function HourFromTime(t: number): number;
|
|
78
78
|
export declare function MinFromTime(t: number): number;
|
|
79
79
|
export declare function SecFromTime(t: number): number;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
* The abstract operation OrdinaryHasInstance implements
|
|
82
|
+
* the default algorithm for determining if an object O
|
|
83
|
+
* inherits from the instance object inheritance path
|
|
84
|
+
* provided by constructor C.
|
|
85
|
+
* @param C class
|
|
86
|
+
* @param O object
|
|
87
|
+
* @param internalSlots internalSlots
|
|
88
|
+
*/
|
|
89
89
|
export declare function OrdinaryHasInstance(C: object, O: any, internalSlots?: {
|
|
90
|
-
|
|
90
|
+
boundTargetFunction: any;
|
|
91
91
|
}): boolean;
|
|
92
92
|
export declare function msFromTime(t: number): number;
|
|
93
|
-
export declare function ToPrimitive<T extends
|
|
93
|
+
export declare function ToPrimitive<T extends "string" | "number" = "string" | "number">(input: any, preferredType: T): string | number | boolean | undefined | null;
|