@formatjs/ecma402-abstract 3.0.6 → 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.
Files changed (99) hide show
  1. package/262.d.ts +55 -55
  2. package/262.js +322 -327
  3. package/CanonicalizeLocaleList.d.ts +3 -3
  4. package/CanonicalizeLocaleList.js +5 -5
  5. package/CanonicalizeTimeZoneName.d.ts +13 -6
  6. package/CanonicalizeTimeZoneName.js +88 -15
  7. package/CoerceOptionsToObject.d.ts +4 -4
  8. package/CoerceOptionsToObject.js +9 -9
  9. package/DefaultNumberOption.d.ts +6 -6
  10. package/DefaultNumberOption.js +15 -15
  11. package/GetNumberOption.d.ts +5 -9
  12. package/GetNumberOption.js +10 -10
  13. package/GetOption.d.ts +12 -8
  14. package/GetOption.js +28 -28
  15. package/GetOptionsObject.d.ts +4 -4
  16. package/GetOptionsObject.js +11 -11
  17. package/GetStringOrBooleanOption.d.ts +4 -10
  18. package/GetStringOrBooleanOption.js +28 -28
  19. package/IsSanctionedSimpleUnitIdentifier.d.ts +8 -6
  20. package/IsSanctionedSimpleUnitIdentifier.js +53 -53
  21. package/IsValidTimeZoneName.d.ts +15 -7
  22. package/IsValidTimeZoneName.js +69 -15
  23. package/IsWellFormedCurrencyCode.d.ts +2 -2
  24. package/IsWellFormedCurrencyCode.js +15 -15
  25. package/IsWellFormedUnitIdentifier.d.ts +3 -3
  26. package/IsWellFormedUnitIdentifier.js +21 -22
  27. package/NumberFormat/ApplyUnsignedRoundingMode.d.ts +2 -2
  28. package/NumberFormat/ApplyUnsignedRoundingMode.js +31 -31
  29. package/NumberFormat/CollapseNumberRange.d.ts +6 -6
  30. package/NumberFormat/CollapseNumberRange.js +47 -47
  31. package/NumberFormat/ComputeExponent.d.ts +8 -8
  32. package/NumberFormat/ComputeExponent.js +48 -58
  33. package/NumberFormat/ComputeExponentForMagnitude.d.ts +6 -6
  34. package/NumberFormat/ComputeExponentForMagnitude.js +64 -63
  35. package/NumberFormat/CurrencyDigits.d.ts +3 -3
  36. package/NumberFormat/CurrencyDigits.js +5 -8
  37. package/NumberFormat/FormatApproximately.d.ts +3 -3
  38. package/NumberFormat/FormatApproximately.js +10 -6
  39. package/NumberFormat/FormatNumeric.d.ts +2 -2
  40. package/NumberFormat/FormatNumeric.js +4 -3
  41. package/NumberFormat/FormatNumericRange.d.ts +6 -6
  42. package/NumberFormat/FormatNumericRange.js +7 -9
  43. package/NumberFormat/FormatNumericRangeToParts.d.ts +6 -6
  44. package/NumberFormat/FormatNumericRangeToParts.js +12 -14
  45. package/NumberFormat/FormatNumericToParts.d.ts +3 -3
  46. package/NumberFormat/FormatNumericToParts.js +12 -12
  47. package/NumberFormat/FormatNumericToString.d.ts +7 -7
  48. package/NumberFormat/FormatNumericToString.js +79 -81
  49. package/NumberFormat/GetUnsignedRoundingMode.d.ts +1 -1
  50. package/NumberFormat/GetUnsignedRoundingMode.js +25 -24
  51. package/NumberFormat/InitializeNumberFormat.d.ts +10 -10
  52. package/NumberFormat/InitializeNumberFormat.js +83 -64
  53. package/NumberFormat/PartitionNumberPattern.d.ts +4 -4
  54. package/NumberFormat/PartitionNumberPattern.js +112 -123
  55. package/NumberFormat/PartitionNumberRangePattern.d.ts +6 -6
  56. package/NumberFormat/PartitionNumberRangePattern.js +41 -38
  57. package/NumberFormat/SetNumberFormatDigitOptions.d.ts +3 -3
  58. package/NumberFormat/SetNumberFormatDigitOptions.js +185 -174
  59. package/NumberFormat/SetNumberFormatUnitOptions.d.ts +3 -3
  60. package/NumberFormat/SetNumberFormatUnitOptions.js +62 -48
  61. package/NumberFormat/ToRawFixed.d.ts +7 -7
  62. package/NumberFormat/ToRawFixed.js +103 -107
  63. package/NumberFormat/ToRawPrecision.d.ts +7 -7
  64. package/NumberFormat/ToRawPrecision.js +199 -202
  65. package/NumberFormat/decimal-cache.d.ts +10 -10
  66. package/NumberFormat/decimal-cache.js +13 -13
  67. package/NumberFormat/digit-mapping.generated.js +781 -781
  68. package/NumberFormat/format_to_parts.d.ts +24 -20
  69. package/NumberFormat/format_to_parts.js +446 -420
  70. package/PartitionPattern.d.ts +6 -6
  71. package/PartitionPattern.js +33 -33
  72. package/SupportedLocales.d.ts +6 -6
  73. package/SupportedLocales.js +17 -17
  74. package/ToIntlMathematicalValue.d.ts +1 -1
  75. package/ToIntlMathematicalValue.js +24 -25
  76. package/constants.d.ts +1 -1
  77. package/constants.js +4 -4
  78. package/data.d.ts +1 -1
  79. package/data.js +4 -11
  80. package/index.d.ts +47 -47
  81. package/index.js +45 -45
  82. package/package.json +3 -3
  83. package/regex.generated.d.ts +1 -0
  84. package/regex.generated.js +1 -1
  85. package/types/core.d.ts +5 -5
  86. package/types/date-time.d.ts +123 -128
  87. package/types/date-time.js +6 -6
  88. package/types/displaynames.d.ts +55 -55
  89. package/types/displaynames.js +1 -1
  90. package/types/list.d.ts +11 -11
  91. package/types/list.js +1 -1
  92. package/types/number.d.ts +151 -137
  93. package/types/number.js +2 -1
  94. package/types/plural-rules.d.ts +11 -11
  95. package/types/plural-rules.js +2 -1
  96. package/types/relative-time.d.ts +26 -32
  97. package/types/relative-time.js +2 -1
  98. package/utils.d.ts +40 -14
  99. package/utils.js +63 -116
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Partition a pattern into a list of literals and placeholders
3
- * https://tc39.es/ecma402/#sec-partitionpattern
4
- * @param pattern
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
- type: T;
8
- value: string | undefined;
7
+ type: T;
8
+ value: string | undefined;
9
9
  }>;
@@ -1,36 +1,36 @@
1
- import { invariant } from './utils.js';
1
+ import { invariant } from "./utils.js";
2
2
  /**
3
- * Partition a pattern into a list of literals and placeholders
4
- * https://tc39.es/ecma402/#sec-partitionpattern
5
- * @param pattern
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
- var result = [];
9
- var beginIndex = pattern.indexOf('{');
10
- var endIndex = 0;
11
- var nextIndex = 0;
12
- var length = pattern.length;
13
- while (beginIndex < pattern.length && beginIndex > -1) {
14
- endIndex = pattern.indexOf('}', beginIndex);
15
- invariant(endIndex > beginIndex, "Invalid pattern ".concat(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;
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
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
- * https://tc39.es/ecma402/#sec-supportedlocales
3
- * @param availableLocales
4
- * @param requestedLocales
5
- * @param options
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
- localeMatcher?: 'best fit' | 'lookup';
8
+ localeMatcher?: "best fit" | "lookup";
9
9
  }): string[];
@@ -1,20 +1,20 @@
1
- import { LookupSupportedLocales } from '@formatjs/intl-localematcher';
2
- import { ToObject } from './262.js';
3
- import { GetOption } from './GetOption.js';
1
+ import { LookupSupportedLocales } from "@formatjs/intl-localematcher";
2
+ import { ToObject } from "./262.js";
3
+ import { GetOption } from "./GetOption.js";
4
4
  /**
5
- * https://tc39.es/ecma402/#sec-supportedlocales
6
- * @param availableLocales
7
- * @param requestedLocales
8
- * @param options
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
- var 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);
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 'decimal.js';
1
+ import { Decimal } from "decimal.js";
2
2
  export declare function ToIntlMathematicalValue(input: unknown): Decimal;
@@ -1,27 +1,26 @@
1
- import { Decimal } from 'decimal.js';
2
- import { ToPrimitive } from './262.js';
1
+ import { Decimal } from "decimal.js";
2
+ import { ToPrimitive } from "./262.js";
3
3
  export function ToIntlMathematicalValue(input) {
4
- var 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
- }
24
- catch (_a) {
25
- return new Decimal(NaN);
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
@@ -1,4 +1,4 @@
1
- import { Decimal } from 'decimal.js';
1
+ import { Decimal } from "decimal.js";
2
2
  export declare const TEN: Decimal;
3
3
  export declare const ZERO: Decimal;
4
4
  export declare const NEGATIVE_ZERO: Decimal;
package/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Decimal } from 'decimal.js';
2
- export var TEN = new Decimal(10);
3
- export var ZERO = new Decimal(0);
4
- export var NEGATIVE_ZERO = new Decimal(-0);
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
@@ -1,5 +1,5 @@
1
1
  declare class MissingLocaleDataError extends Error {
2
- type: string;
2
+ type: string;
3
3
  }
4
4
  export declare function isMissingLocaleDataError(e: Error): e is MissingLocaleDataError;
5
5
  export {};
package/data.js CHANGED
@@ -1,13 +1,6 @@
1
- import { __extends } from "tslib";
2
- var MissingLocaleDataError = /** @class */ (function (_super) {
3
- __extends(MissingLocaleDataError, _super);
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
- return e.type === 'MISSING_LOCALE_DATA';
5
+ return e.type === "MISSING_LOCALE_DATA";
13
6
  }
package/index.d.ts CHANGED
@@ -1,47 +1,47 @@
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';
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 './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';
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.6",
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/fast-memoize": "3.0.1",
17
- "@formatjs/intl-localematcher": "0.7.3"
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",
@@ -1 +1,2 @@
1
+ // @generated from regex-gen.ts
1
2
  export declare const S_UNICODE_REGEX: RegExp;
@@ -1,2 +1,2 @@
1
1
  // @generated from regex-gen.ts
2
- export 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-\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]/;
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
- data: T;
4
- locale: Locale;
3
+ data: T;
4
+ locale: Locale;
5
5
  }
6
6
  export interface LookupMatcherResult {
7
- locale: string;
8
- extension?: string;
9
- nu?: string;
7
+ locale: string;
8
+ extension?: string;
9
+ nu?: string;
10
10
  }