@formatjs/ecma402-abstract 3.0.7 → 3.0.8
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 +322 -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 +8 -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 +31 -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 +24 -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 +1 -1
- package/ToIntlMathematicalValue.js +24 -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 +3 -3
- package/regex.generated.d.ts +1 -0
- 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 +151 -137
- package/types/number.js +2 -1
- package/types/plural-rules.d.ts +11 -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 +40 -14
- package/utils.js +63 -116
package/PartitionPattern.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
* Partition a pattern into a list of literals and placeholders
|
|
3
|
+
* https://tc39.es/ecma402/#sec-partitionpattern
|
|
4
|
+
* @param pattern
|
|
5
|
+
*/
|
|
6
6
|
export declare function PartitionPattern<T extends string>(pattern: string): Array<{
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
type: T;
|
|
8
|
+
value: string | undefined;
|
|
9
9
|
}>;
|
package/PartitionPattern.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { invariant } from
|
|
1
|
+
import { invariant } from "./utils.js";
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
* Partition a pattern into a list of literals and placeholders
|
|
4
|
+
* https://tc39.es/ecma402/#sec-partitionpattern
|
|
5
|
+
* @param pattern
|
|
6
|
+
*/
|
|
7
7
|
export function PartitionPattern(pattern) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
8
|
+
const result = [];
|
|
9
|
+
let beginIndex = pattern.indexOf("{");
|
|
10
|
+
let endIndex = 0;
|
|
11
|
+
let nextIndex = 0;
|
|
12
|
+
const length = pattern.length;
|
|
13
|
+
while (beginIndex < pattern.length && beginIndex > -1) {
|
|
14
|
+
endIndex = pattern.indexOf("}", beginIndex);
|
|
15
|
+
invariant(endIndex > beginIndex, `Invalid pattern ${pattern}`);
|
|
16
|
+
if (beginIndex > nextIndex) {
|
|
17
|
+
result.push({
|
|
18
|
+
type: "literal",
|
|
19
|
+
value: pattern.substring(nextIndex, beginIndex)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
result.push({
|
|
23
|
+
type: pattern.substring(beginIndex + 1, endIndex),
|
|
24
|
+
value: undefined
|
|
25
|
+
});
|
|
26
|
+
nextIndex = endIndex + 1;
|
|
27
|
+
beginIndex = pattern.indexOf("{", nextIndex);
|
|
28
|
+
}
|
|
29
|
+
if (nextIndex < length) {
|
|
30
|
+
result.push({
|
|
31
|
+
type: "literal",
|
|
32
|
+
value: pattern.substring(nextIndex, length)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
36
|
}
|
package/SupportedLocales.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
* https://tc39.es/ecma402/#sec-supportedlocales
|
|
3
|
+
* @param availableLocales
|
|
4
|
+
* @param requestedLocales
|
|
5
|
+
* @param options
|
|
6
|
+
*/
|
|
7
7
|
export declare function SupportedLocales(availableLocales: Set<string>, requestedLocales: string[], options?: {
|
|
8
|
-
|
|
8
|
+
localeMatcher?: "best fit" | "lookup";
|
|
9
9
|
}): string[];
|
package/SupportedLocales.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { LookupSupportedLocales } from
|
|
2
|
-
import { ToObject } from
|
|
3
|
-
import { GetOption } from
|
|
1
|
+
import { LookupSupportedLocales } from "@formatjs/intl-localematcher";
|
|
2
|
+
import { ToObject } from "./262.js";
|
|
3
|
+
import { GetOption } from "./GetOption.js";
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
* https://tc39.es/ecma402/#sec-supportedlocales
|
|
6
|
+
* @param availableLocales
|
|
7
|
+
* @param requestedLocales
|
|
8
|
+
* @param options
|
|
9
|
+
*/
|
|
10
10
|
export function SupportedLocales(availableLocales, requestedLocales, options) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
let matcher = "best fit";
|
|
12
|
+
if (options !== undefined) {
|
|
13
|
+
options = ToObject(options);
|
|
14
|
+
matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
|
|
15
|
+
}
|
|
16
|
+
if (matcher === "best fit") {
|
|
17
|
+
return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
|
|
18
|
+
}
|
|
19
|
+
return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
|
|
20
20
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Decimal } from
|
|
1
|
+
import { Decimal } from "decimal.js";
|
|
2
2
|
export declare function ToIntlMathematicalValue(input: unknown): Decimal;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { Decimal } from
|
|
2
|
-
import { ToPrimitive } from
|
|
1
|
+
import { Decimal } from "decimal.js";
|
|
2
|
+
import { ToPrimitive } from "./262.js";
|
|
3
3
|
export function ToIntlMathematicalValue(input) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
4
|
+
let primValue = ToPrimitive(input, "number");
|
|
5
|
+
if (typeof primValue === "bigint") {
|
|
6
|
+
return new Decimal(primValue);
|
|
7
|
+
}
|
|
8
|
+
// IMPL
|
|
9
|
+
if (primValue === undefined) {
|
|
10
|
+
return new Decimal(NaN);
|
|
11
|
+
}
|
|
12
|
+
if (primValue === true) {
|
|
13
|
+
return new Decimal(1);
|
|
14
|
+
}
|
|
15
|
+
if (primValue === false) {
|
|
16
|
+
return new Decimal(0);
|
|
17
|
+
}
|
|
18
|
+
if (primValue === null) {
|
|
19
|
+
return new Decimal(0);
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return new Decimal(primValue);
|
|
23
|
+
} catch {
|
|
24
|
+
return new Decimal(NaN);
|
|
25
|
+
}
|
|
27
26
|
}
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Decimal } from
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
import { Decimal } from "decimal.js";
|
|
2
|
+
export const TEN = new Decimal(10);
|
|
3
|
+
export const ZERO = new Decimal(0);
|
|
4
|
+
export const NEGATIVE_ZERO = new Decimal(-0);
|
package/data.d.ts
CHANGED
package/data.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function MissingLocaleDataError() {
|
|
5
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
6
|
-
_this.type = 'MISSING_LOCALE_DATA';
|
|
7
|
-
return _this;
|
|
8
|
-
}
|
|
9
|
-
return MissingLocaleDataError;
|
|
10
|
-
}(Error));
|
|
1
|
+
class MissingLocaleDataError extends Error {
|
|
2
|
+
type = "MISSING_LOCALE_DATA";
|
|
3
|
+
}
|
|
11
4
|
export function isMissingLocaleDataError(e) {
|
|
12
|
-
|
|
5
|
+
return e.type === "MISSING_LOCALE_DATA";
|
|
13
6
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export { default as _formatToParts } from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export { createDataProperty, defineProperty, getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots
|
|
35
|
-
export type { LiteralPart } from
|
|
36
|
-
export * from
|
|
37
|
-
export { isMissingLocaleDataError } from
|
|
38
|
-
export type { LocaleData } from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
41
|
-
export * from
|
|
42
|
-
export * from
|
|
43
|
-
export * from
|
|
44
|
-
export * from
|
|
45
|
-
export { createMemoizedDateTimeFormat, createMemoizedListFormat, createMemoizedLocale, createMemoizedNumberFormat, createMemoizedPluralRules, invariant
|
|
46
|
-
export { ZERO } from
|
|
47
|
-
export { ToIntlMathematicalValue } from
|
|
1
|
+
export * from "./CanonicalizeLocaleList.js";
|
|
2
|
+
export * from "./CanonicalizeTimeZoneName.js";
|
|
3
|
+
export * from "./CoerceOptionsToObject.js";
|
|
4
|
+
export * from "./GetNumberOption.js";
|
|
5
|
+
export * from "./GetOption.js";
|
|
6
|
+
export * from "./GetOptionsObject.js";
|
|
7
|
+
export * from "./GetStringOrBooleanOption.js";
|
|
8
|
+
export * from "./IsSanctionedSimpleUnitIdentifier.js";
|
|
9
|
+
export * from "./IsValidTimeZoneName.js";
|
|
10
|
+
export * from "./IsWellFormedCurrencyCode.js";
|
|
11
|
+
export * from "./IsWellFormedUnitIdentifier.js";
|
|
12
|
+
export * from "./NumberFormat/ApplyUnsignedRoundingMode.js";
|
|
13
|
+
export * from "./NumberFormat/CollapseNumberRange.js";
|
|
14
|
+
export * from "./NumberFormat/ComputeExponent.js";
|
|
15
|
+
export * from "./NumberFormat/ComputeExponentForMagnitude.js";
|
|
16
|
+
export * from "./NumberFormat/CurrencyDigits.js";
|
|
17
|
+
export { default as _formatToParts } from "./NumberFormat/format_to_parts.js";
|
|
18
|
+
export * from "./NumberFormat/FormatApproximately.js";
|
|
19
|
+
export * from "./NumberFormat/FormatNumeric.js";
|
|
20
|
+
export * from "./NumberFormat/FormatNumericRange.js";
|
|
21
|
+
export * from "./NumberFormat/FormatNumericRangeToParts.js";
|
|
22
|
+
export * from "./NumberFormat/FormatNumericToParts.js";
|
|
23
|
+
export * from "./NumberFormat/FormatNumericToString.js";
|
|
24
|
+
export * from "./NumberFormat/GetUnsignedRoundingMode.js";
|
|
25
|
+
export * from "./NumberFormat/InitializeNumberFormat.js";
|
|
26
|
+
export * from "./NumberFormat/PartitionNumberPattern.js";
|
|
27
|
+
export * from "./NumberFormat/PartitionNumberRangePattern.js";
|
|
28
|
+
export * from "./NumberFormat/SetNumberFormatDigitOptions.js";
|
|
29
|
+
export * from "./NumberFormat/SetNumberFormatUnitOptions.js";
|
|
30
|
+
export * from "./NumberFormat/ToRawFixed.js";
|
|
31
|
+
export * from "./NumberFormat/ToRawPrecision.js";
|
|
32
|
+
export * from "./PartitionPattern.js";
|
|
33
|
+
export * from "./SupportedLocales.js";
|
|
34
|
+
export { createDataProperty, defineProperty, getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots } from "./utils.js";
|
|
35
|
+
export type { LiteralPart } from "./utils.js";
|
|
36
|
+
export * from "./262.js";
|
|
37
|
+
export { isMissingLocaleDataError } from "./data.js";
|
|
38
|
+
export type { LocaleData } from "./types/core.js";
|
|
39
|
+
export * from "./types/date-time.js";
|
|
40
|
+
export * from "./types/displaynames.js";
|
|
41
|
+
export * from "./types/list.js";
|
|
42
|
+
export * from "./types/number.js";
|
|
43
|
+
export * from "./types/plural-rules.js";
|
|
44
|
+
export * from "./types/relative-time.js";
|
|
45
|
+
export { createMemoizedDateTimeFormat, createMemoizedListFormat, createMemoizedLocale, createMemoizedNumberFormat, createMemoizedPluralRules, invariant } from "./utils.js";
|
|
46
|
+
export { ZERO } from "./constants.js";
|
|
47
|
+
export { ToIntlMathematicalValue } from "./ToIntlMathematicalValue.js";
|
package/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export { default as _formatToParts } from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export { createDataProperty, defineProperty, getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots
|
|
35
|
-
export * from
|
|
36
|
-
export { isMissingLocaleDataError } from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
41
|
-
export * from
|
|
42
|
-
export * from
|
|
43
|
-
export { createMemoizedDateTimeFormat, createMemoizedListFormat, createMemoizedLocale, createMemoizedNumberFormat, createMemoizedPluralRules, invariant
|
|
44
|
-
export { ZERO } from
|
|
45
|
-
export { ToIntlMathematicalValue } from
|
|
1
|
+
export * from "./CanonicalizeLocaleList.js";
|
|
2
|
+
export * from "./CanonicalizeTimeZoneName.js";
|
|
3
|
+
export * from "./CoerceOptionsToObject.js";
|
|
4
|
+
export * from "./GetNumberOption.js";
|
|
5
|
+
export * from "./GetOption.js";
|
|
6
|
+
export * from "./GetOptionsObject.js";
|
|
7
|
+
export * from "./GetStringOrBooleanOption.js";
|
|
8
|
+
export * from "./IsSanctionedSimpleUnitIdentifier.js";
|
|
9
|
+
export * from "./IsValidTimeZoneName.js";
|
|
10
|
+
export * from "./IsWellFormedCurrencyCode.js";
|
|
11
|
+
export * from "./IsWellFormedUnitIdentifier.js";
|
|
12
|
+
export * from "./NumberFormat/ApplyUnsignedRoundingMode.js";
|
|
13
|
+
export * from "./NumberFormat/CollapseNumberRange.js";
|
|
14
|
+
export * from "./NumberFormat/ComputeExponent.js";
|
|
15
|
+
export * from "./NumberFormat/ComputeExponentForMagnitude.js";
|
|
16
|
+
export * from "./NumberFormat/CurrencyDigits.js";
|
|
17
|
+
export { default as _formatToParts } from "./NumberFormat/format_to_parts.js";
|
|
18
|
+
export * from "./NumberFormat/FormatApproximately.js";
|
|
19
|
+
export * from "./NumberFormat/FormatNumeric.js";
|
|
20
|
+
export * from "./NumberFormat/FormatNumericRange.js";
|
|
21
|
+
export * from "./NumberFormat/FormatNumericRangeToParts.js";
|
|
22
|
+
export * from "./NumberFormat/FormatNumericToParts.js";
|
|
23
|
+
export * from "./NumberFormat/FormatNumericToString.js";
|
|
24
|
+
export * from "./NumberFormat/GetUnsignedRoundingMode.js";
|
|
25
|
+
export * from "./NumberFormat/InitializeNumberFormat.js";
|
|
26
|
+
export * from "./NumberFormat/PartitionNumberPattern.js";
|
|
27
|
+
export * from "./NumberFormat/PartitionNumberRangePattern.js";
|
|
28
|
+
export * from "./NumberFormat/SetNumberFormatDigitOptions.js";
|
|
29
|
+
export * from "./NumberFormat/SetNumberFormatUnitOptions.js";
|
|
30
|
+
export * from "./NumberFormat/ToRawFixed.js";
|
|
31
|
+
export * from "./NumberFormat/ToRawPrecision.js";
|
|
32
|
+
export * from "./PartitionPattern.js";
|
|
33
|
+
export * from "./SupportedLocales.js";
|
|
34
|
+
export { createDataProperty, defineProperty, getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots } from "./utils.js";
|
|
35
|
+
export * from "./262.js";
|
|
36
|
+
export { isMissingLocaleDataError } from "./data.js";
|
|
37
|
+
export * from "./types/date-time.js";
|
|
38
|
+
export * from "./types/displaynames.js";
|
|
39
|
+
export * from "./types/list.js";
|
|
40
|
+
export * from "./types/number.js";
|
|
41
|
+
export * from "./types/plural-rules.js";
|
|
42
|
+
export * from "./types/relative-time.js";
|
|
43
|
+
export { createMemoizedDateTimeFormat, createMemoizedListFormat, createMemoizedLocale, createMemoizedNumberFormat, createMemoizedPluralRules, invariant } from "./utils.js";
|
|
44
|
+
export { ZERO } from "./constants.js";
|
|
45
|
+
export { ToIntlMathematicalValue } from "./ToIntlMathematicalValue.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/ecma402-abstract",
|
|
3
3
|
"description": "A collection of implementation for ECMAScript abstract operations",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Long Ho <holevietlong@gmail.com",
|
|
7
7
|
"type": "module",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"decimal.js": "^10.4.3",
|
|
15
15
|
"tslib": "^2.8.0",
|
|
16
|
-
"@formatjs/
|
|
17
|
-
"@formatjs/
|
|
16
|
+
"@formatjs/fast-memoize": "3.0.3",
|
|
17
|
+
"@formatjs/intl-localematcher": "0.7.5"
|
|
18
18
|
},
|
|
19
19
|
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
20
20
|
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
|
package/regex.generated.d.ts
CHANGED
package/regex.generated.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @generated from regex-gen.ts
|
|
2
|
-
export
|
|
2
|
+
export const 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-\u20BF\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-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\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-\uFBC1\uFDFC\uFDFD\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]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\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-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
|
package/types/core.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type Locale = string;
|
|
2
2
|
export interface LocaleData<T> {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
data: T;
|
|
4
|
+
locale: Locale;
|
|
5
5
|
}
|
|
6
6
|
export interface LookupMatcherResult {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
locale: string;
|
|
8
|
+
extension?: string;
|
|
9
|
+
nu?: string;
|
|
10
10
|
}
|