@formatjs/ecma402-abstract 1.11.8 → 1.11.9

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 (277) hide show
  1. package/262.ts +372 -0
  2. package/BUILD +97 -0
  3. package/CHANGELOG.md +709 -0
  4. package/CanonicalizeLocaleList.ts +8 -0
  5. package/CanonicalizeTimeZoneName.ts +29 -0
  6. package/CoerceOptionsToObject.ts +13 -0
  7. package/DefaultNumberOption.ts +28 -0
  8. package/GetNumberOption.ts +29 -0
  9. package/GetOption.ts +38 -0
  10. package/GetOptionsObject.ts +14 -0
  11. package/IsSanctionedSimpleUnitIdentifier.ts +66 -0
  12. package/IsValidTimeZoneName.ts +27 -0
  13. package/IsWellFormedCurrencyCode.ts +23 -0
  14. package/IsWellFormedUnitIdentifier.ts +32 -0
  15. package/LICENSE.md +0 -0
  16. package/NumberFormat/ComputeExponent.ts +49 -0
  17. package/NumberFormat/ComputeExponentForMagnitude.ts +71 -0
  18. package/NumberFormat/CurrencyDigits.ts +13 -0
  19. package/NumberFormat/FormatNumericToParts.ts +22 -0
  20. package/NumberFormat/FormatNumericToString.ts +71 -0
  21. package/NumberFormat/InitializeNumberFormat.ts +147 -0
  22. package/NumberFormat/PartitionNumberPattern.ts +86 -0
  23. package/NumberFormat/SetNumberFormatDigitOptions.ts +45 -0
  24. package/NumberFormat/SetNumberFormatUnitOptions.ts +77 -0
  25. package/NumberFormat/ToRawFixed.ts +56 -0
  26. package/NumberFormat/ToRawPrecision.ts +86 -0
  27. package/NumberFormat/digit-mapping.generated.ts +1 -0
  28. package/NumberFormat/format_to_parts.ts +571 -0
  29. package/PartitionPattern.ts +38 -0
  30. package/README.md +0 -0
  31. package/SupportedLocales.ts +31 -0
  32. package/data.ts +9 -0
  33. package/index.ts +45 -0
  34. package/package.json +3 -3
  35. package/regex.generated.ts +2 -0
  36. package/scripts/digit-mapping.ts +109 -0
  37. package/scripts/regex-gen.ts +19 -0
  38. package/tests/PartitionPattern.test.ts +38 -0
  39. package/tests/ToRawFixed.test.tsx +41 -0
  40. package/tests/ToRawPrecision.test.tsx +65 -0
  41. package/tsconfig.json +5 -0
  42. package/types/core.ts +11 -0
  43. package/types/date-time.ts +199 -0
  44. package/types/displaynames.ts +48 -0
  45. package/types/list.ts +22 -0
  46. package/types/number.ts +240 -0
  47. package/types/plural-rules.ts +18 -0
  48. package/types/relative-time.ts +74 -0
  49. package/utils.ts +128 -0
  50. package/262.d.ts +0 -92
  51. package/262.d.ts.map +0 -1
  52. package/262.js +0 -362
  53. package/CanonicalizeLocaleList.d.ts +0 -6
  54. package/CanonicalizeLocaleList.d.ts.map +0 -1
  55. package/CanonicalizeLocaleList.js +0 -12
  56. package/CanonicalizeTimeZoneName.d.ts +0 -9
  57. package/CanonicalizeTimeZoneName.d.ts.map +0 -1
  58. package/CanonicalizeTimeZoneName.js +0 -21
  59. package/CoerceOptionsToObject.d.ts +0 -7
  60. package/CoerceOptionsToObject.d.ts.map +0 -1
  61. package/CoerceOptionsToObject.js +0 -16
  62. package/DefaultNumberOption.d.ts +0 -9
  63. package/DefaultNumberOption.d.ts.map +0 -1
  64. package/DefaultNumberOption.js +0 -14
  65. package/GetNumberOption.d.ts +0 -10
  66. package/GetNumberOption.d.ts.map +0 -1
  67. package/GetNumberOption.js +0 -18
  68. package/GetOption.d.ts +0 -10
  69. package/GetOption.d.ts.map +0 -1
  70. package/GetOption.js +0 -35
  71. package/GetOptionsObject.d.ts +0 -7
  72. package/GetOptionsObject.d.ts.map +0 -1
  73. package/GetOptionsObject.js +0 -18
  74. package/IsSanctionedSimpleUnitIdentifier.d.ts +0 -14
  75. package/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
  76. package/IsSanctionedSimpleUnitIdentifier.js +0 -68
  77. package/IsValidTimeZoneName.d.ts +0 -10
  78. package/IsValidTimeZoneName.d.ts.map +0 -1
  79. package/IsValidTimeZoneName.js +0 -23
  80. package/IsWellFormedCurrencyCode.d.ts +0 -5
  81. package/IsWellFormedCurrencyCode.d.ts.map +0 -1
  82. package/IsWellFormedCurrencyCode.js +0 -25
  83. package/IsWellFormedUnitIdentifier.d.ts +0 -6
  84. package/IsWellFormedUnitIdentifier.d.ts.map +0 -1
  85. package/IsWellFormedUnitIdentifier.js +0 -32
  86. package/NumberFormat/ComputeExponent.d.ts +0 -12
  87. package/NumberFormat/ComputeExponent.d.ts.map +0 -1
  88. package/NumberFormat/ComputeExponent.js +0 -43
  89. package/NumberFormat/ComputeExponentForMagnitude.d.ts +0 -10
  90. package/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
  91. package/NumberFormat/ComputeExponentForMagnitude.js +0 -64
  92. package/NumberFormat/CurrencyDigits.d.ts +0 -7
  93. package/NumberFormat/CurrencyDigits.d.ts.map +0 -1
  94. package/NumberFormat/CurrencyDigits.js +0 -14
  95. package/NumberFormat/FormatNumericToParts.d.ts +0 -5
  96. package/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
  97. package/NumberFormat/FormatNumericToParts.js +0 -18
  98. package/NumberFormat/FormatNumericToString.d.ts +0 -9
  99. package/NumberFormat/FormatNumericToString.d.ts.map +0 -1
  100. package/NumberFormat/FormatNumericToString.js +0 -45
  101. package/NumberFormat/InitializeNumberFormat.d.ts +0 -13
  102. package/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
  103. package/NumberFormat/InitializeNumberFormat.js +0 -68
  104. package/NumberFormat/PartitionNumberPattern.d.ts +0 -8
  105. package/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
  106. package/NumberFormat/PartitionNumberPattern.js +0 -80
  107. package/NumberFormat/SetNumberFormatDigitOptions.d.ts +0 -6
  108. package/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
  109. package/NumberFormat/SetNumberFormatDigitOptions.js +0 -40
  110. package/NumberFormat/SetNumberFormatUnitOptions.d.ts +0 -8
  111. package/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
  112. package/NumberFormat/SetNumberFormatUnitOptions.js +0 -43
  113. package/NumberFormat/ToRawFixed.d.ts +0 -10
  114. package/NumberFormat/ToRawFixed.d.ts.map +0 -1
  115. package/NumberFormat/ToRawFixed.js +0 -55
  116. package/NumberFormat/ToRawPrecision.d.ts +0 -3
  117. package/NumberFormat/ToRawPrecision.d.ts.map +0 -1
  118. package/NumberFormat/ToRawPrecision.js +0 -78
  119. package/NumberFormat/digit-mapping.generated.d.ts +0 -2
  120. package/NumberFormat/digit-mapping.generated.d.ts.map +0 -1
  121. package/NumberFormat/digit-mapping.generated.js +0 -4
  122. package/NumberFormat/format_to_parts.d.ts +0 -22
  123. package/NumberFormat/format_to_parts.d.ts.map +0 -1
  124. package/NumberFormat/format_to_parts.js +0 -424
  125. package/PartitionPattern.d.ts +0 -9
  126. package/PartitionPattern.d.ts.map +0 -1
  127. package/PartitionPattern.js +0 -39
  128. package/SupportedLocales.d.ts +0 -10
  129. package/SupportedLocales.d.ts.map +0 -1
  130. package/SupportedLocales.js +0 -24
  131. package/data.d.ts +0 -6
  132. package/data.d.ts.map +0 -1
  133. package/data.js +0 -17
  134. package/index.d.ts +0 -37
  135. package/index.d.ts.map +0 -1
  136. package/index.js +0 -48
  137. package/lib/262.d.ts +0 -92
  138. package/lib/262.d.ts.map +0 -1
  139. package/lib/262.js +0 -336
  140. package/lib/CanonicalizeLocaleList.d.ts +0 -6
  141. package/lib/CanonicalizeLocaleList.d.ts.map +0 -1
  142. package/lib/CanonicalizeLocaleList.js +0 -8
  143. package/lib/CanonicalizeTimeZoneName.d.ts +0 -9
  144. package/lib/CanonicalizeTimeZoneName.d.ts.map +0 -1
  145. package/lib/CanonicalizeTimeZoneName.js +0 -17
  146. package/lib/CoerceOptionsToObject.d.ts +0 -7
  147. package/lib/CoerceOptionsToObject.d.ts.map +0 -1
  148. package/lib/CoerceOptionsToObject.js +0 -12
  149. package/lib/DefaultNumberOption.d.ts +0 -9
  150. package/lib/DefaultNumberOption.d.ts.map +0 -1
  151. package/lib/DefaultNumberOption.js +0 -10
  152. package/lib/GetNumberOption.d.ts +0 -10
  153. package/lib/GetNumberOption.d.ts.map +0 -1
  154. package/lib/GetNumberOption.js +0 -14
  155. package/lib/GetOption.d.ts +0 -10
  156. package/lib/GetOption.d.ts.map +0 -1
  157. package/lib/GetOption.js +0 -31
  158. package/lib/GetOptionsObject.d.ts +0 -7
  159. package/lib/GetOptionsObject.d.ts.map +0 -1
  160. package/lib/GetOptionsObject.js +0 -14
  161. package/lib/IsSanctionedSimpleUnitIdentifier.d.ts +0 -14
  162. package/lib/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
  163. package/lib/IsSanctionedSimpleUnitIdentifier.js +0 -63
  164. package/lib/IsValidTimeZoneName.d.ts +0 -10
  165. package/lib/IsValidTimeZoneName.d.ts.map +0 -1
  166. package/lib/IsValidTimeZoneName.js +0 -19
  167. package/lib/IsWellFormedCurrencyCode.d.ts +0 -5
  168. package/lib/IsWellFormedCurrencyCode.d.ts.map +0 -1
  169. package/lib/IsWellFormedCurrencyCode.js +0 -21
  170. package/lib/IsWellFormedUnitIdentifier.d.ts +0 -6
  171. package/lib/IsWellFormedUnitIdentifier.d.ts.map +0 -1
  172. package/lib/IsWellFormedUnitIdentifier.js +0 -28
  173. package/lib/NumberFormat/ComputeExponent.d.ts +0 -12
  174. package/lib/NumberFormat/ComputeExponent.d.ts.map +0 -1
  175. package/lib/NumberFormat/ComputeExponent.js +0 -39
  176. package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts +0 -10
  177. package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
  178. package/lib/NumberFormat/ComputeExponentForMagnitude.js +0 -60
  179. package/lib/NumberFormat/CurrencyDigits.d.ts +0 -7
  180. package/lib/NumberFormat/CurrencyDigits.d.ts.map +0 -1
  181. package/lib/NumberFormat/CurrencyDigits.js +0 -10
  182. package/lib/NumberFormat/FormatNumericToParts.d.ts +0 -5
  183. package/lib/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
  184. package/lib/NumberFormat/FormatNumericToParts.js +0 -14
  185. package/lib/NumberFormat/FormatNumericToString.d.ts +0 -9
  186. package/lib/NumberFormat/FormatNumericToString.d.ts.map +0 -1
  187. package/lib/NumberFormat/FormatNumericToString.js +0 -41
  188. package/lib/NumberFormat/InitializeNumberFormat.d.ts +0 -13
  189. package/lib/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
  190. package/lib/NumberFormat/InitializeNumberFormat.js +0 -64
  191. package/lib/NumberFormat/PartitionNumberPattern.d.ts +0 -8
  192. package/lib/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
  193. package/lib/NumberFormat/PartitionNumberPattern.js +0 -75
  194. package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts +0 -6
  195. package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
  196. package/lib/NumberFormat/SetNumberFormatDigitOptions.js +0 -36
  197. package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts +0 -8
  198. package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
  199. package/lib/NumberFormat/SetNumberFormatUnitOptions.js +0 -39
  200. package/lib/NumberFormat/ToRawFixed.d.ts +0 -10
  201. package/lib/NumberFormat/ToRawFixed.d.ts.map +0 -1
  202. package/lib/NumberFormat/ToRawFixed.js +0 -51
  203. package/lib/NumberFormat/ToRawPrecision.d.ts +0 -3
  204. package/lib/NumberFormat/ToRawPrecision.d.ts.map +0 -1
  205. package/lib/NumberFormat/ToRawPrecision.js +0 -74
  206. package/lib/NumberFormat/digit-mapping.generated.d.ts +0 -2
  207. package/lib/NumberFormat/digit-mapping.generated.d.ts.map +0 -1
  208. package/lib/NumberFormat/digit-mapping.generated.js +0 -1
  209. package/lib/NumberFormat/format_to_parts.d.ts +0 -22
  210. package/lib/NumberFormat/format_to_parts.d.ts.map +0 -1
  211. package/lib/NumberFormat/format_to_parts.js +0 -421
  212. package/lib/PartitionPattern.d.ts +0 -9
  213. package/lib/PartitionPattern.d.ts.map +0 -1
  214. package/lib/PartitionPattern.js +0 -35
  215. package/lib/SupportedLocales.d.ts +0 -10
  216. package/lib/SupportedLocales.d.ts.map +0 -1
  217. package/lib/SupportedLocales.js +0 -20
  218. package/lib/data.d.ts +0 -6
  219. package/lib/data.d.ts.map +0 -1
  220. package/lib/data.js +0 -13
  221. package/lib/index.d.ts +0 -37
  222. package/lib/index.d.ts.map +0 -1
  223. package/lib/index.js +0 -34
  224. package/lib/regex.generated.d.ts +0 -2
  225. package/lib/regex.generated.d.ts.map +0 -1
  226. package/lib/regex.generated.js +0 -2
  227. package/lib/types/core.d.ts +0 -11
  228. package/lib/types/core.d.ts.map +0 -1
  229. package/lib/types/core.js +0 -1
  230. package/lib/types/date-time.d.ts +0 -135
  231. package/lib/types/date-time.d.ts.map +0 -1
  232. package/lib/types/date-time.js +0 -6
  233. package/lib/types/displaynames.d.ts +0 -47
  234. package/lib/types/displaynames.d.ts.map +0 -1
  235. package/lib/types/displaynames.js +0 -1
  236. package/lib/types/list.d.ts +0 -19
  237. package/lib/types/list.d.ts.map +0 -1
  238. package/lib/types/list.js +0 -1
  239. package/lib/types/number.d.ts +0 -147
  240. package/lib/types/number.d.ts.map +0 -1
  241. package/lib/types/number.js +0 -1
  242. package/lib/types/plural-rules.d.ts +0 -17
  243. package/lib/types/plural-rules.d.ts.map +0 -1
  244. package/lib/types/plural-rules.js +0 -1
  245. package/lib/types/relative-time.d.ts +0 -41
  246. package/lib/types/relative-time.d.ts.map +0 -1
  247. package/lib/types/relative-time.js +0 -1
  248. package/lib/utils.d.ts +0 -24
  249. package/lib/utils.d.ts.map +0 -1
  250. package/lib/utils.js +0 -78
  251. package/regex.generated.d.ts +0 -2
  252. package/regex.generated.d.ts.map +0 -1
  253. package/regex.generated.js +0 -5
  254. package/types/core.d.ts +0 -11
  255. package/types/core.d.ts.map +0 -1
  256. package/types/core.js +0 -2
  257. package/types/date-time.d.ts +0 -135
  258. package/types/date-time.d.ts.map +0 -1
  259. package/types/date-time.js +0 -9
  260. package/types/displaynames.d.ts +0 -47
  261. package/types/displaynames.d.ts.map +0 -1
  262. package/types/displaynames.js +0 -2
  263. package/types/list.d.ts +0 -19
  264. package/types/list.d.ts.map +0 -1
  265. package/types/list.js +0 -2
  266. package/types/number.d.ts +0 -147
  267. package/types/number.d.ts.map +0 -1
  268. package/types/number.js +0 -2
  269. package/types/plural-rules.d.ts +0 -17
  270. package/types/plural-rules.d.ts.map +0 -1
  271. package/types/plural-rules.js +0 -2
  272. package/types/relative-time.d.ts +0 -41
  273. package/types/relative-time.d.ts.map +0 -1
  274. package/types/relative-time.js +0 -2
  275. package/utils.d.ts +0 -24
  276. package/utils.d.ts.map +0 -1
  277. package/utils.js +0 -90
@@ -1,421 +0,0 @@
1
- import { ToRawFixed } from './ToRawFixed';
2
- import { digitMapping } from './digit-mapping.generated';
3
- import { S_UNICODE_REGEX } from '../regex.generated';
4
- // This is from: unicode-12.1.0/General_Category/Symbol/regex.js
5
- // IE11 does not support unicode flag, otherwise this is just /\p{S}/u.
6
- // /^\p{S}/u
7
- var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
8
- // /\p{S}$/u
9
- var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
10
- var CLDR_NUMBER_PATTERN = /[#0](?:[\.,][#0]+)*/g;
11
- export default function formatToParts(numberResult, data, pl, options) {
12
- var sign = numberResult.sign, exponent = numberResult.exponent, magnitude = numberResult.magnitude;
13
- var notation = options.notation, style = options.style, numberingSystem = options.numberingSystem;
14
- var defaultNumberingSystem = data.numbers.nu[0];
15
- // #region Part 1: partition and interpolate the CLDR number pattern.
16
- // ----------------------------------------------------------
17
- var compactNumberPattern = null;
18
- if (notation === 'compact' && magnitude) {
19
- compactNumberPattern = getCompactDisplayPattern(numberResult, pl, data, style, options.compactDisplay, options.currencyDisplay, numberingSystem);
20
- }
21
- // This is used multiple times
22
- var nonNameCurrencyPart;
23
- if (style === 'currency' && options.currencyDisplay !== 'name') {
24
- var byCurrencyDisplay = data.currencies[options.currency];
25
- if (byCurrencyDisplay) {
26
- switch (options.currencyDisplay) {
27
- case 'code':
28
- nonNameCurrencyPart = options.currency;
29
- break;
30
- case 'symbol':
31
- nonNameCurrencyPart = byCurrencyDisplay.symbol;
32
- break;
33
- default:
34
- nonNameCurrencyPart = byCurrencyDisplay.narrow;
35
- break;
36
- }
37
- }
38
- else {
39
- // Fallback for unknown currency
40
- nonNameCurrencyPart = options.currency;
41
- }
42
- }
43
- var numberPattern;
44
- if (!compactNumberPattern) {
45
- // Note: if the style is unit, or is currency and the currency display is name,
46
- // its unit parts will be interpolated in part 2. So here we can fallback to decimal.
47
- if (style === 'decimal' ||
48
- style === 'unit' ||
49
- (style === 'currency' && options.currencyDisplay === 'name')) {
50
- // Shortcut for decimal
51
- var decimalData = data.numbers.decimal[numberingSystem] ||
52
- data.numbers.decimal[defaultNumberingSystem];
53
- numberPattern = getPatternForSign(decimalData.standard, sign);
54
- }
55
- else if (style === 'currency') {
56
- var currencyData = data.numbers.currency[numberingSystem] ||
57
- data.numbers.currency[defaultNumberingSystem];
58
- // We replace number pattern part with `0` for easier postprocessing.
59
- numberPattern = getPatternForSign(currencyData[options.currencySign], sign);
60
- }
61
- else {
62
- // percent
63
- var percentPattern = data.numbers.percent[numberingSystem] ||
64
- data.numbers.percent[defaultNumberingSystem];
65
- numberPattern = getPatternForSign(percentPattern, sign);
66
- }
67
- }
68
- else {
69
- numberPattern = compactNumberPattern;
70
- }
71
- // Extract the decimal number pattern string. It looks like "#,##0,00", which will later be
72
- // used to infer decimal group sizes.
73
- var decimalNumberPattern = CLDR_NUMBER_PATTERN.exec(numberPattern)[0];
74
- // Now we start to substitute patterns
75
- // 1. replace strings like `0` and `#,##0.00` with `{0}`
76
- // 2. unquote characters (invariant: the quoted characters does not contain the special tokens)
77
- numberPattern = numberPattern
78
- .replace(CLDR_NUMBER_PATTERN, '{0}')
79
- .replace(/'(.)'/g, '$1');
80
- // Handle currency spacing (both compact and non-compact).
81
- if (style === 'currency' && options.currencyDisplay !== 'name') {
82
- var currencyData = data.numbers.currency[numberingSystem] ||
83
- data.numbers.currency[defaultNumberingSystem];
84
- // See `currencySpacing` substitution rule in TR-35.
85
- // Here we always assume the currencyMatch is "[:^S:]" and surroundingMatch is "[:digit:]".
86
- //
87
- // Example 1: for pattern "#,##0.00¤" with symbol "US$", we replace "¤" with the symbol,
88
- // but insert an extra non-break space before the symbol, because "[:^S:]" matches "U" in
89
- // "US$" and "[:digit:]" matches the latn numbering system digits.
90
- //
91
- // Example 2: for pattern "¤#,##0.00" with symbol "US$", there is no spacing between symbol
92
- // and number, because `$` does not match "[:^S:]".
93
- //
94
- // Implementation note: here we do the best effort to infer the insertion.
95
- // We also assume that `beforeInsertBetween` and `afterInsertBetween` will never be `;`.
96
- var afterCurrency = currencyData.currencySpacing.afterInsertBetween;
97
- if (afterCurrency && !S_DOLLAR_UNICODE_REGEX.test(nonNameCurrencyPart)) {
98
- numberPattern = numberPattern.replace('¤{0}', "\u00A4".concat(afterCurrency, "{0}"));
99
- }
100
- var beforeCurrency = currencyData.currencySpacing.beforeInsertBetween;
101
- if (beforeCurrency && !CARET_S_UNICODE_REGEX.test(nonNameCurrencyPart)) {
102
- numberPattern = numberPattern.replace('{0}¤', "{0}".concat(beforeCurrency, "\u00A4"));
103
- }
104
- }
105
- // The following tokens are special: `{0}`, `¤`, `%`, `-`, `+`, `{c:...}.
106
- var numberPatternParts = numberPattern.split(/({c:[^}]+}|\{0\}|[¤%\-\+])/g);
107
- var numberParts = [];
108
- var symbols = data.numbers.symbols[numberingSystem] ||
109
- data.numbers.symbols[defaultNumberingSystem];
110
- for (var _i = 0, numberPatternParts_1 = numberPatternParts; _i < numberPatternParts_1.length; _i++) {
111
- var part = numberPatternParts_1[_i];
112
- if (!part) {
113
- continue;
114
- }
115
- switch (part) {
116
- case '{0}': {
117
- // We only need to handle scientific and engineering notation here.
118
- numberParts.push.apply(numberParts, paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem,
119
- // If compact number pattern exists, do not insert group separators.
120
- !compactNumberPattern && options.useGrouping, decimalNumberPattern));
121
- break;
122
- }
123
- case '-':
124
- numberParts.push({ type: 'minusSign', value: symbols.minusSign });
125
- break;
126
- case '+':
127
- numberParts.push({ type: 'plusSign', value: symbols.plusSign });
128
- break;
129
- case '%':
130
- numberParts.push({ type: 'percentSign', value: symbols.percentSign });
131
- break;
132
- case '¤':
133
- // Computed above when handling currency spacing.
134
- numberParts.push({ type: 'currency', value: nonNameCurrencyPart });
135
- break;
136
- default:
137
- if (/^\{c:/.test(part)) {
138
- numberParts.push({
139
- type: 'compact',
140
- value: part.substring(3, part.length - 1),
141
- });
142
- }
143
- else {
144
- // literal
145
- numberParts.push({ type: 'literal', value: part });
146
- }
147
- break;
148
- }
149
- }
150
- // #endregion
151
- // #region Part 2: interpolate unit pattern if necessary.
152
- // ----------------------------------------------
153
- switch (style) {
154
- case 'currency': {
155
- // `currencyDisplay: 'name'` has similar pattern handling as units.
156
- if (options.currencyDisplay === 'name') {
157
- var unitPattern = (data.numbers.currency[numberingSystem] ||
158
- data.numbers.currency[defaultNumberingSystem]).unitPattern;
159
- // Select plural
160
- var unitName = void 0;
161
- var currencyNameData = data.currencies[options.currency];
162
- if (currencyNameData) {
163
- unitName = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), currencyNameData.displayName);
164
- }
165
- else {
166
- // Fallback for unknown currency
167
- unitName = options.currency;
168
- }
169
- // Do {0} and {1} substitution
170
- var unitPatternParts = unitPattern.split(/(\{[01]\})/g);
171
- var result = [];
172
- for (var _a = 0, unitPatternParts_1 = unitPatternParts; _a < unitPatternParts_1.length; _a++) {
173
- var part = unitPatternParts_1[_a];
174
- switch (part) {
175
- case '{0}':
176
- result.push.apply(result, numberParts);
177
- break;
178
- case '{1}':
179
- result.push({ type: 'currency', value: unitName });
180
- break;
181
- default:
182
- if (part) {
183
- result.push({ type: 'literal', value: part });
184
- }
185
- break;
186
- }
187
- }
188
- return result;
189
- }
190
- else {
191
- return numberParts;
192
- }
193
- }
194
- case 'unit': {
195
- var unit = options.unit, unitDisplay = options.unitDisplay;
196
- var unitData = data.units.simple[unit];
197
- var unitPattern = void 0;
198
- if (unitData) {
199
- // Simple unit pattern
200
- unitPattern = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), data.units.simple[unit][unitDisplay]);
201
- }
202
- else {
203
- // See: http://unicode.org/reports/tr35/tr35-general.html#perUnitPatterns
204
- // If cannot find unit in the simple pattern, it must be "per" compound pattern.
205
- // Implementation note: we are not following TR-35 here because we need to format to parts!
206
- var _b = unit.split('-per-'), numeratorUnit = _b[0], denominatorUnit = _b[1];
207
- unitData = data.units.simple[numeratorUnit];
208
- var numeratorUnitPattern = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), data.units.simple[numeratorUnit][unitDisplay]);
209
- var perUnitPattern = data.units.simple[denominatorUnit].perUnit[unitDisplay];
210
- if (perUnitPattern) {
211
- // perUnitPattern exists, combine it with numeratorUnitPattern
212
- unitPattern = perUnitPattern.replace('{0}', numeratorUnitPattern);
213
- }
214
- else {
215
- // get compoundUnit pattern (e.g. "{0} per {1}"), repalce {0} with numerator pattern and {1} with
216
- // the denominator pattern in singular form.
217
- var perPattern = data.units.compound.per[unitDisplay];
218
- var denominatorPattern = selectPlural(pl, 1, data.units.simple[denominatorUnit][unitDisplay]);
219
- unitPattern = unitPattern = perPattern
220
- .replace('{0}', numeratorUnitPattern)
221
- .replace('{1}', denominatorPattern.replace('{0}', ''));
222
- }
223
- }
224
- var result = [];
225
- // We need spacing around "{0}" because they are not treated as "unit" parts, but "literal".
226
- for (var _c = 0, _d = unitPattern.split(/(\s*\{0\}\s*)/); _c < _d.length; _c++) {
227
- var part = _d[_c];
228
- var interpolateMatch = /^(\s*)\{0\}(\s*)$/.exec(part);
229
- if (interpolateMatch) {
230
- // Space before "{0}"
231
- if (interpolateMatch[1]) {
232
- result.push({ type: 'literal', value: interpolateMatch[1] });
233
- }
234
- // "{0}" itself
235
- result.push.apply(result, numberParts);
236
- // Space after "{0}"
237
- if (interpolateMatch[2]) {
238
- result.push({ type: 'literal', value: interpolateMatch[2] });
239
- }
240
- }
241
- else if (part) {
242
- result.push({ type: 'unit', value: part });
243
- }
244
- }
245
- return result;
246
- }
247
- default:
248
- return numberParts;
249
- }
250
- // #endregion
251
- }
252
- // A subset of https://tc39.es/ecma402/#sec-partitionnotationsubpattern
253
- // Plus the exponent parts handling.
254
- function paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem, useGrouping,
255
- /**
256
- * This is the decimal number pattern without signs or symbols.
257
- * It is used to infer the group size when `useGrouping` is true.
258
- *
259
- * A typical value looks like "#,##0.00" (primary group size is 3).
260
- * Some locales like Hindi has secondary group size of 2 (e.g. "#,##,##0.00").
261
- */
262
- decimalNumberPattern) {
263
- var result = [];
264
- // eslint-disable-next-line prefer-const
265
- var n = numberResult.formattedString, x = numberResult.roundedNumber;
266
- if (isNaN(x)) {
267
- return [{ type: 'nan', value: n }];
268
- }
269
- else if (!isFinite(x)) {
270
- return [{ type: 'infinity', value: n }];
271
- }
272
- var digitReplacementTable = digitMapping[numberingSystem];
273
- if (digitReplacementTable) {
274
- n = n.replace(/\d/g, function (digit) { return digitReplacementTable[+digit] || digit; });
275
- }
276
- // TODO: Else use an implementation dependent algorithm to map n to the appropriate
277
- // representation of n in the given numbering system.
278
- var decimalSepIndex = n.indexOf('.');
279
- var integer;
280
- var fraction;
281
- if (decimalSepIndex > 0) {
282
- integer = n.slice(0, decimalSepIndex);
283
- fraction = n.slice(decimalSepIndex + 1);
284
- }
285
- else {
286
- integer = n;
287
- }
288
- // #region Grouping integer digits
289
- // The weird compact and x >= 10000 check is to ensure consistency with Node.js and Chrome.
290
- // Note that `de` does not have compact form for thousands, but Node.js does not insert grouping separator
291
- // unless the rounded number is greater than 10000:
292
- // NumberFormat('de', {notation: 'compact', compactDisplay: 'short'}).format(1234) //=> "1234"
293
- // NumberFormat('de').format(1234) //=> "1.234"
294
- if (useGrouping && (notation !== 'compact' || x >= 10000)) {
295
- var groupSepSymbol = symbols.group;
296
- var groups = [];
297
- // > There may be two different grouping sizes: The primary grouping size used for the least
298
- // > significant integer group, and the secondary grouping size used for more significant groups.
299
- // > If a pattern contains multiple grouping separators, the interval between the last one and the
300
- // > end of the integer defines the primary grouping size, and the interval between the last two
301
- // > defines the secondary grouping size. All others are ignored.
302
- var integerNumberPattern = decimalNumberPattern.split('.')[0];
303
- var patternGroups = integerNumberPattern.split(',');
304
- var primaryGroupingSize = 3;
305
- var secondaryGroupingSize = 3;
306
- if (patternGroups.length > 1) {
307
- primaryGroupingSize = patternGroups[patternGroups.length - 1].length;
308
- }
309
- if (patternGroups.length > 2) {
310
- secondaryGroupingSize = patternGroups[patternGroups.length - 2].length;
311
- }
312
- var i = integer.length - primaryGroupingSize;
313
- if (i > 0) {
314
- // Slice the least significant integer group
315
- groups.push(integer.slice(i, i + primaryGroupingSize));
316
- // Then iteratively push the more signicant groups
317
- // TODO: handle surrogate pairs in some numbering system digits
318
- for (i -= secondaryGroupingSize; i > 0; i -= secondaryGroupingSize) {
319
- groups.push(integer.slice(i, i + secondaryGroupingSize));
320
- }
321
- groups.push(integer.slice(0, i + secondaryGroupingSize));
322
- }
323
- else {
324
- groups.push(integer);
325
- }
326
- while (groups.length > 0) {
327
- var integerGroup = groups.pop();
328
- result.push({ type: 'integer', value: integerGroup });
329
- if (groups.length > 0) {
330
- result.push({ type: 'group', value: groupSepSymbol });
331
- }
332
- }
333
- }
334
- else {
335
- result.push({ type: 'integer', value: integer });
336
- }
337
- // #endregion
338
- if (fraction !== undefined) {
339
- result.push({ type: 'decimal', value: symbols.decimal }, { type: 'fraction', value: fraction });
340
- }
341
- if ((notation === 'scientific' || notation === 'engineering') &&
342
- isFinite(x)) {
343
- result.push({ type: 'exponentSeparator', value: symbols.exponential });
344
- if (exponent < 0) {
345
- result.push({ type: 'exponentMinusSign', value: symbols.minusSign });
346
- exponent = -exponent;
347
- }
348
- var exponentResult = ToRawFixed(exponent, 0, 0);
349
- result.push({
350
- type: 'exponentInteger',
351
- value: exponentResult.formattedString,
352
- });
353
- }
354
- return result;
355
- }
356
- function getPatternForSign(pattern, sign) {
357
- if (pattern.indexOf(';') < 0) {
358
- pattern = "".concat(pattern, ";-").concat(pattern);
359
- }
360
- var _a = pattern.split(';'), zeroPattern = _a[0], negativePattern = _a[1];
361
- switch (sign) {
362
- case 0:
363
- return zeroPattern;
364
- case -1:
365
- return negativePattern;
366
- default:
367
- return negativePattern.indexOf('-') >= 0
368
- ? negativePattern.replace(/-/g, '+')
369
- : "+".concat(zeroPattern);
370
- }
371
- }
372
- // Find the CLDR pattern for compact notation based on the magnitude of data and style.
373
- //
374
- // Example return value: "¤ {c:laki}000;¤{c:laki} -0" (`sw` locale):
375
- // - Notice the `{c:...}` token that wraps the compact literal.
376
- // - The consecutive zeros are normalized to single zero to match CLDR_NUMBER_PATTERN.
377
- //
378
- // Returning null means the compact display pattern cannot be found.
379
- function getCompactDisplayPattern(numberResult, pl, data, style, compactDisplay, currencyDisplay, numberingSystem) {
380
- var _a;
381
- var roundedNumber = numberResult.roundedNumber, sign = numberResult.sign, magnitude = numberResult.magnitude;
382
- var magnitudeKey = String(Math.pow(10, magnitude));
383
- var defaultNumberingSystem = data.numbers.nu[0];
384
- var pattern;
385
- if (style === 'currency' && currencyDisplay !== 'name') {
386
- var byNumberingSystem = data.numbers.currency;
387
- var currencyData = byNumberingSystem[numberingSystem] ||
388
- byNumberingSystem[defaultNumberingSystem];
389
- // NOTE: compact notation ignores currencySign!
390
- var compactPluralRules = (_a = currencyData.short) === null || _a === void 0 ? void 0 : _a[magnitudeKey];
391
- if (!compactPluralRules) {
392
- return null;
393
- }
394
- pattern = selectPlural(pl, roundedNumber, compactPluralRules);
395
- }
396
- else {
397
- var byNumberingSystem = data.numbers.decimal;
398
- var byCompactDisplay = byNumberingSystem[numberingSystem] ||
399
- byNumberingSystem[defaultNumberingSystem];
400
- var compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];
401
- if (!compactPlaralRule) {
402
- return null;
403
- }
404
- pattern = selectPlural(pl, roundedNumber, compactPlaralRule);
405
- }
406
- // See https://unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats
407
- // > If the value is precisely “0”, either explicit or defaulted, then the normal number format
408
- // > pattern for that sort of object is supplied.
409
- if (pattern === '0') {
410
- return null;
411
- }
412
- pattern = getPatternForSign(pattern, sign)
413
- // Extract compact literal from the pattern
414
- .replace(/([^\s;\-\+\d¤]+)/g, '{c:$1}')
415
- // We replace one or more zeros with a single zero so it matches `CLDR_NUMBER_PATTERN`.
416
- .replace(/0+/, '0');
417
- return pattern;
418
- }
419
- function selectPlural(pl, x, rules) {
420
- return rules[pl.select(x)] || rules.other;
421
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * https://tc39.es/ecma402/#sec-partitionpattern
3
- * @param pattern
4
- */
5
- export declare function PartitionPattern<T extends string>(pattern: string): Array<{
6
- type: T;
7
- value: string | undefined;
8
- }>;
9
- //# sourceMappingURL=PartitionPattern.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PartitionPattern.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/PartitionPattern.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,OAAO,EAAE,MAAM,GACd,KAAK,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,CAAC,CA6B7C"}
@@ -1,35 +0,0 @@
1
- import { invariant } from './utils';
2
- /**
3
- * https://tc39.es/ecma402/#sec-partitionpattern
4
- * @param pattern
5
- */
6
- export function PartitionPattern(pattern) {
7
- var result = [];
8
- var beginIndex = pattern.indexOf('{');
9
- var endIndex = 0;
10
- var nextIndex = 0;
11
- var length = pattern.length;
12
- while (beginIndex < pattern.length && beginIndex > -1) {
13
- endIndex = pattern.indexOf('}', beginIndex);
14
- invariant(endIndex > beginIndex, "Invalid pattern ".concat(pattern));
15
- if (beginIndex > nextIndex) {
16
- result.push({
17
- type: 'literal',
18
- value: pattern.substring(nextIndex, beginIndex),
19
- });
20
- }
21
- result.push({
22
- type: pattern.substring(beginIndex + 1, endIndex),
23
- value: undefined,
24
- });
25
- nextIndex = endIndex + 1;
26
- beginIndex = pattern.indexOf('{', nextIndex);
27
- }
28
- if (nextIndex < length) {
29
- result.push({
30
- type: 'literal',
31
- value: pattern.substring(nextIndex, length),
32
- });
33
- }
34
- return result;
35
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * https://tc39.es/ecma402/#sec-supportedlocales
3
- * @param availableLocales
4
- * @param requestedLocales
5
- * @param options
6
- */
7
- export declare function SupportedLocales(availableLocales: Set<string>, requestedLocales: string[], options?: {
8
- localeMatcher?: 'best fit' | 'lookup';
9
- }): string[];
10
- //# sourceMappingURL=SupportedLocales.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedLocales.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/SupportedLocales.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC7B,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,CAAC,EAAE;IAAC,aAAa,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAA;CAAC,GAChD,MAAM,EAAE,CAgBV"}
@@ -1,20 +0,0 @@
1
- import { ToObject } from './262';
2
- import { GetOption } from './GetOption';
3
- import { LookupSupportedLocales } from '@formatjs/intl-localematcher';
4
- /**
5
- * https://tc39.es/ecma402/#sec-supportedlocales
6
- * @param availableLocales
7
- * @param requestedLocales
8
- * @param options
9
- */
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(availableLocales, requestedLocales);
18
- }
19
- return LookupSupportedLocales(availableLocales, requestedLocales);
20
- }
package/lib/data.d.ts DELETED
@@ -1,6 +0,0 @@
1
- declare class MissingLocaleDataError extends Error {
2
- type: string;
3
- }
4
- export declare function isMissingLocaleDataError(e: Error): e is MissingLocaleDataError;
5
- export {};
6
- //# sourceMappingURL=data.d.ts.map
package/lib/data.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/data.ts"],"names":[],"mappings":"AAAA,cAAM,sBAAuB,SAAQ,KAAK;IACjC,IAAI,SAAwB;CACpC;AAED,wBAAgB,wBAAwB,CACtC,CAAC,EAAE,KAAK,GACP,CAAC,IAAI,sBAAsB,CAE7B"}
package/lib/data.js DELETED
@@ -1,13 +0,0 @@
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));
11
- export function isMissingLocaleDataError(e) {
12
- return e.type === 'MISSING_LOCALE_DATA';
13
- }
package/lib/index.d.ts DELETED
@@ -1,37 +0,0 @@
1
- export * from './CanonicalizeLocaleList';
2
- export * from './CanonicalizeTimeZoneName';
3
- export * from './CoerceOptionsToObject';
4
- export * from './GetNumberOption';
5
- export * from './GetOption';
6
- export * from './GetOptionsObject';
7
- export * from './IsSanctionedSimpleUnitIdentifier';
8
- export * from './IsValidTimeZoneName';
9
- export * from './IsWellFormedCurrencyCode';
10
- export * from './IsWellFormedUnitIdentifier';
11
- export * from './NumberFormat/ComputeExponent';
12
- export * from './NumberFormat/ComputeExponentForMagnitude';
13
- export * from './NumberFormat/CurrencyDigits';
14
- export * from './NumberFormat/FormatNumericToParts';
15
- export * from './NumberFormat/FormatNumericToString';
16
- export * from './NumberFormat/InitializeNumberFormat';
17
- export * from './NumberFormat/PartitionNumberPattern';
18
- export * from './NumberFormat/SetNumberFormatDigitOptions';
19
- export * from './NumberFormat/SetNumberFormatUnitOptions';
20
- export * from './NumberFormat/ToRawFixed';
21
- export * from './NumberFormat/ToRawPrecision';
22
- export { default as _formatToParts } from './NumberFormat/format_to_parts';
23
- export * from './PartitionPattern';
24
- export * from './SupportedLocales';
25
- export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './utils';
26
- export type { LiteralPart } from './utils';
27
- export { isMissingLocaleDataError } from './data';
28
- export * from './types/relative-time';
29
- export * from './types/date-time';
30
- export * from './types/list';
31
- export * from './types/plural-rules';
32
- export * from './types/number';
33
- export * from './types/displaynames';
34
- export { invariant } from './utils';
35
- export type { LocaleData } from './types/core';
36
- export * from './262';
37
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oCAAoC,CAAA;AAClD,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,4CAA4C,CAAA;AAC1D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qCAAqC,CAAA;AACnD,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA;AACrD,cAAc,uCAAuC,CAAA;AACrD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,2CAA2C,CAAA;AACzD,cAAc,2BAA2B,CAAA;AACzC,cAAc,+BAA+B,CAAA;AAC7C,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,gCAAgC,CAAA;AACxE,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,cAAc,GACf,MAAM,SAAS,CAAA;AAChB,YAAY,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AAExC,OAAO,EAAC,wBAAwB,EAAC,MAAM,QAAQ,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAA;AACjC,YAAY,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AAC5C,cAAc,OAAO,CAAA"}
package/lib/index.js DELETED
@@ -1,34 +0,0 @@
1
- export * from './CanonicalizeLocaleList';
2
- export * from './CanonicalizeTimeZoneName';
3
- export * from './CoerceOptionsToObject';
4
- export * from './GetNumberOption';
5
- export * from './GetOption';
6
- export * from './GetOptionsObject';
7
- export * from './IsSanctionedSimpleUnitIdentifier';
8
- export * from './IsValidTimeZoneName';
9
- export * from './IsWellFormedCurrencyCode';
10
- export * from './IsWellFormedUnitIdentifier';
11
- export * from './NumberFormat/ComputeExponent';
12
- export * from './NumberFormat/ComputeExponentForMagnitude';
13
- export * from './NumberFormat/CurrencyDigits';
14
- export * from './NumberFormat/FormatNumericToParts';
15
- export * from './NumberFormat/FormatNumericToString';
16
- export * from './NumberFormat/InitializeNumberFormat';
17
- export * from './NumberFormat/PartitionNumberPattern';
18
- export * from './NumberFormat/SetNumberFormatDigitOptions';
19
- export * from './NumberFormat/SetNumberFormatUnitOptions';
20
- export * from './NumberFormat/ToRawFixed';
21
- export * from './NumberFormat/ToRawPrecision';
22
- export { default as _formatToParts } from './NumberFormat/format_to_parts';
23
- export * from './PartitionPattern';
24
- export * from './SupportedLocales';
25
- export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './utils';
26
- export { isMissingLocaleDataError } from './data';
27
- export * from './types/relative-time';
28
- export * from './types/date-time';
29
- export * from './types/list';
30
- export * from './types/plural-rules';
31
- export * from './types/number';
32
- export * from './types/displaynames';
33
- export { invariant } from './utils';
34
- export * from './262';
@@ -1,2 +0,0 @@
1
- export declare const S_UNICODE_REGEX: RegExp;
2
- //# sourceMappingURL=regex.generated.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"regex.generated.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/regex.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,QAAy8E,CAAA"}
@@ -1,2 +0,0 @@
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]/;
@@ -1,11 +0,0 @@
1
- export declare type Locale = string;
2
- export interface LocaleData<T> {
3
- data: T;
4
- locale: Locale;
5
- }
6
- export interface LookupMatcherResult {
7
- locale: string;
8
- extension?: string;
9
- nu?: string;
10
- }
11
- //# sourceMappingURL=core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/types/core.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM,GAAG,MAAM,CAAA;AAC3B,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ"}
package/lib/types/core.js DELETED
@@ -1 +0,0 @@
1
- export {};