@formatjs/ecma402-abstract 1.11.9 → 1.11.10

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 (275) hide show
  1. package/262.d.ts +92 -0
  2. package/262.d.ts.map +1 -0
  3. package/262.js +362 -0
  4. package/CanonicalizeLocaleList.d.ts +6 -0
  5. package/CanonicalizeLocaleList.d.ts.map +1 -0
  6. package/CanonicalizeLocaleList.js +12 -0
  7. package/CanonicalizeTimeZoneName.d.ts +9 -0
  8. package/CanonicalizeTimeZoneName.d.ts.map +1 -0
  9. package/CanonicalizeTimeZoneName.js +21 -0
  10. package/CoerceOptionsToObject.d.ts +7 -0
  11. package/CoerceOptionsToObject.d.ts.map +1 -0
  12. package/CoerceOptionsToObject.js +16 -0
  13. package/DefaultNumberOption.d.ts +9 -0
  14. package/DefaultNumberOption.d.ts.map +1 -0
  15. package/DefaultNumberOption.js +14 -0
  16. package/GetNumberOption.d.ts +10 -0
  17. package/GetNumberOption.d.ts.map +1 -0
  18. package/GetNumberOption.js +18 -0
  19. package/GetOption.d.ts +10 -0
  20. package/GetOption.d.ts.map +1 -0
  21. package/GetOption.js +35 -0
  22. package/GetOptionsObject.d.ts +7 -0
  23. package/GetOptionsObject.d.ts.map +1 -0
  24. package/GetOptionsObject.js +18 -0
  25. package/IsSanctionedSimpleUnitIdentifier.d.ts +14 -0
  26. package/IsSanctionedSimpleUnitIdentifier.d.ts.map +1 -0
  27. package/IsSanctionedSimpleUnitIdentifier.js +68 -0
  28. package/IsValidTimeZoneName.d.ts +10 -0
  29. package/IsValidTimeZoneName.d.ts.map +1 -0
  30. package/IsValidTimeZoneName.js +23 -0
  31. package/IsWellFormedCurrencyCode.d.ts +5 -0
  32. package/IsWellFormedCurrencyCode.d.ts.map +1 -0
  33. package/IsWellFormedCurrencyCode.js +25 -0
  34. package/IsWellFormedUnitIdentifier.d.ts +6 -0
  35. package/IsWellFormedUnitIdentifier.d.ts.map +1 -0
  36. package/IsWellFormedUnitIdentifier.js +32 -0
  37. package/NumberFormat/ComputeExponent.d.ts +12 -0
  38. package/NumberFormat/ComputeExponent.d.ts.map +1 -0
  39. package/NumberFormat/ComputeExponent.js +43 -0
  40. package/NumberFormat/ComputeExponentForMagnitude.d.ts +10 -0
  41. package/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
  42. package/NumberFormat/ComputeExponentForMagnitude.js +64 -0
  43. package/NumberFormat/CurrencyDigits.d.ts +7 -0
  44. package/NumberFormat/CurrencyDigits.d.ts.map +1 -0
  45. package/NumberFormat/CurrencyDigits.js +14 -0
  46. package/NumberFormat/FormatNumericToParts.d.ts +5 -0
  47. package/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
  48. package/NumberFormat/FormatNumericToParts.js +18 -0
  49. package/NumberFormat/FormatNumericToString.d.ts +9 -0
  50. package/NumberFormat/FormatNumericToString.d.ts.map +1 -0
  51. package/NumberFormat/FormatNumericToString.js +45 -0
  52. package/NumberFormat/InitializeNumberFormat.d.ts +13 -0
  53. package/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
  54. package/NumberFormat/InitializeNumberFormat.js +68 -0
  55. package/NumberFormat/PartitionNumberPattern.d.ts +8 -0
  56. package/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
  57. package/NumberFormat/PartitionNumberPattern.js +80 -0
  58. package/NumberFormat/SetNumberFormatDigitOptions.d.ts +6 -0
  59. package/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +1 -0
  60. package/NumberFormat/SetNumberFormatDigitOptions.js +40 -0
  61. package/NumberFormat/SetNumberFormatUnitOptions.d.ts +8 -0
  62. package/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
  63. package/NumberFormat/SetNumberFormatUnitOptions.js +43 -0
  64. package/NumberFormat/ToRawFixed.d.ts +10 -0
  65. package/NumberFormat/ToRawFixed.d.ts.map +1 -0
  66. package/NumberFormat/ToRawFixed.js +55 -0
  67. package/NumberFormat/ToRawPrecision.d.ts +3 -0
  68. package/NumberFormat/ToRawPrecision.d.ts.map +1 -0
  69. package/NumberFormat/ToRawPrecision.js +78 -0
  70. package/NumberFormat/digit-mapping.generated.d.ts +2 -0
  71. package/NumberFormat/digit-mapping.generated.d.ts.map +1 -0
  72. package/NumberFormat/digit-mapping.generated.js +4 -0
  73. package/NumberFormat/format_to_parts.d.ts +22 -0
  74. package/NumberFormat/format_to_parts.d.ts.map +1 -0
  75. package/NumberFormat/format_to_parts.js +424 -0
  76. package/PartitionPattern.d.ts +9 -0
  77. package/PartitionPattern.d.ts.map +1 -0
  78. package/PartitionPattern.js +39 -0
  79. package/SupportedLocales.d.ts +10 -0
  80. package/SupportedLocales.d.ts.map +1 -0
  81. package/SupportedLocales.js +24 -0
  82. package/data.d.ts +6 -0
  83. package/data.d.ts.map +1 -0
  84. package/data.js +17 -0
  85. package/index.d.ts +37 -0
  86. package/index.d.ts.map +1 -0
  87. package/index.js +48 -0
  88. package/lib/262.d.ts +92 -0
  89. package/lib/262.d.ts.map +1 -0
  90. package/lib/262.js +336 -0
  91. package/lib/CanonicalizeLocaleList.d.ts +6 -0
  92. package/lib/CanonicalizeLocaleList.d.ts.map +1 -0
  93. package/lib/CanonicalizeLocaleList.js +8 -0
  94. package/lib/CanonicalizeTimeZoneName.d.ts +9 -0
  95. package/lib/CanonicalizeTimeZoneName.d.ts.map +1 -0
  96. package/lib/CanonicalizeTimeZoneName.js +17 -0
  97. package/lib/CoerceOptionsToObject.d.ts +7 -0
  98. package/lib/CoerceOptionsToObject.d.ts.map +1 -0
  99. package/lib/CoerceOptionsToObject.js +12 -0
  100. package/lib/DefaultNumberOption.d.ts +9 -0
  101. package/lib/DefaultNumberOption.d.ts.map +1 -0
  102. package/lib/DefaultNumberOption.js +10 -0
  103. package/lib/GetNumberOption.d.ts +10 -0
  104. package/lib/GetNumberOption.d.ts.map +1 -0
  105. package/lib/GetNumberOption.js +14 -0
  106. package/lib/GetOption.d.ts +10 -0
  107. package/lib/GetOption.d.ts.map +1 -0
  108. package/lib/GetOption.js +31 -0
  109. package/lib/GetOptionsObject.d.ts +7 -0
  110. package/lib/GetOptionsObject.d.ts.map +1 -0
  111. package/lib/GetOptionsObject.js +14 -0
  112. package/lib/IsSanctionedSimpleUnitIdentifier.d.ts +14 -0
  113. package/lib/IsSanctionedSimpleUnitIdentifier.d.ts.map +1 -0
  114. package/lib/IsSanctionedSimpleUnitIdentifier.js +63 -0
  115. package/lib/IsValidTimeZoneName.d.ts +10 -0
  116. package/lib/IsValidTimeZoneName.d.ts.map +1 -0
  117. package/lib/IsValidTimeZoneName.js +19 -0
  118. package/lib/IsWellFormedCurrencyCode.d.ts +5 -0
  119. package/lib/IsWellFormedCurrencyCode.d.ts.map +1 -0
  120. package/lib/IsWellFormedCurrencyCode.js +21 -0
  121. package/lib/IsWellFormedUnitIdentifier.d.ts +6 -0
  122. package/lib/IsWellFormedUnitIdentifier.d.ts.map +1 -0
  123. package/lib/IsWellFormedUnitIdentifier.js +28 -0
  124. package/lib/NumberFormat/ComputeExponent.d.ts +12 -0
  125. package/lib/NumberFormat/ComputeExponent.d.ts.map +1 -0
  126. package/lib/NumberFormat/ComputeExponent.js +39 -0
  127. package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts +10 -0
  128. package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
  129. package/lib/NumberFormat/ComputeExponentForMagnitude.js +60 -0
  130. package/lib/NumberFormat/CurrencyDigits.d.ts +7 -0
  131. package/lib/NumberFormat/CurrencyDigits.d.ts.map +1 -0
  132. package/lib/NumberFormat/CurrencyDigits.js +10 -0
  133. package/lib/NumberFormat/FormatNumericToParts.d.ts +5 -0
  134. package/lib/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
  135. package/lib/NumberFormat/FormatNumericToParts.js +14 -0
  136. package/lib/NumberFormat/FormatNumericToString.d.ts +9 -0
  137. package/lib/NumberFormat/FormatNumericToString.d.ts.map +1 -0
  138. package/lib/NumberFormat/FormatNumericToString.js +41 -0
  139. package/lib/NumberFormat/InitializeNumberFormat.d.ts +13 -0
  140. package/lib/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
  141. package/lib/NumberFormat/InitializeNumberFormat.js +64 -0
  142. package/lib/NumberFormat/PartitionNumberPattern.d.ts +8 -0
  143. package/lib/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
  144. package/lib/NumberFormat/PartitionNumberPattern.js +75 -0
  145. package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts +6 -0
  146. package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +1 -0
  147. package/lib/NumberFormat/SetNumberFormatDigitOptions.js +36 -0
  148. package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts +8 -0
  149. package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
  150. package/lib/NumberFormat/SetNumberFormatUnitOptions.js +39 -0
  151. package/lib/NumberFormat/ToRawFixed.d.ts +10 -0
  152. package/lib/NumberFormat/ToRawFixed.d.ts.map +1 -0
  153. package/lib/NumberFormat/ToRawFixed.js +51 -0
  154. package/lib/NumberFormat/ToRawPrecision.d.ts +3 -0
  155. package/lib/NumberFormat/ToRawPrecision.d.ts.map +1 -0
  156. package/lib/NumberFormat/ToRawPrecision.js +74 -0
  157. package/lib/NumberFormat/digit-mapping.generated.d.ts +2 -0
  158. package/lib/NumberFormat/digit-mapping.generated.d.ts.map +1 -0
  159. package/lib/NumberFormat/digit-mapping.generated.js +1 -0
  160. package/lib/NumberFormat/format_to_parts.d.ts +22 -0
  161. package/lib/NumberFormat/format_to_parts.d.ts.map +1 -0
  162. package/lib/NumberFormat/format_to_parts.js +421 -0
  163. package/lib/PartitionPattern.d.ts +9 -0
  164. package/lib/PartitionPattern.d.ts.map +1 -0
  165. package/lib/PartitionPattern.js +35 -0
  166. package/lib/SupportedLocales.d.ts +10 -0
  167. package/lib/SupportedLocales.d.ts.map +1 -0
  168. package/lib/SupportedLocales.js +20 -0
  169. package/lib/data.d.ts +6 -0
  170. package/lib/data.d.ts.map +1 -0
  171. package/lib/data.js +13 -0
  172. package/lib/index.d.ts +37 -0
  173. package/lib/index.d.ts.map +1 -0
  174. package/lib/index.js +34 -0
  175. package/lib/regex.generated.d.ts +2 -0
  176. package/lib/regex.generated.d.ts.map +1 -0
  177. package/lib/regex.generated.js +2 -0
  178. package/lib/types/core.d.ts +11 -0
  179. package/lib/types/core.d.ts.map +1 -0
  180. package/lib/types/core.js +1 -0
  181. package/lib/types/date-time.d.ts +135 -0
  182. package/lib/types/date-time.d.ts.map +1 -0
  183. package/lib/types/date-time.js +6 -0
  184. package/lib/types/displaynames.d.ts +47 -0
  185. package/lib/types/displaynames.d.ts.map +1 -0
  186. package/lib/types/displaynames.js +1 -0
  187. package/lib/types/list.d.ts +19 -0
  188. package/lib/types/list.d.ts.map +1 -0
  189. package/lib/types/list.js +1 -0
  190. package/lib/types/number.d.ts +147 -0
  191. package/lib/types/number.d.ts.map +1 -0
  192. package/lib/types/number.js +1 -0
  193. package/lib/types/plural-rules.d.ts +17 -0
  194. package/lib/types/plural-rules.d.ts.map +1 -0
  195. package/lib/types/plural-rules.js +1 -0
  196. package/lib/types/relative-time.d.ts +41 -0
  197. package/lib/types/relative-time.d.ts.map +1 -0
  198. package/lib/types/relative-time.js +1 -0
  199. package/lib/utils.d.ts +24 -0
  200. package/lib/utils.d.ts.map +1 -0
  201. package/lib/utils.js +78 -0
  202. package/package.json +2 -2
  203. package/regex.generated.d.ts +2 -0
  204. package/regex.generated.d.ts.map +1 -0
  205. package/regex.generated.js +5 -0
  206. package/types/core.d.ts +11 -0
  207. package/types/core.d.ts.map +1 -0
  208. package/types/core.js +2 -0
  209. package/types/date-time.d.ts +135 -0
  210. package/types/date-time.d.ts.map +1 -0
  211. package/types/date-time.js +9 -0
  212. package/types/displaynames.d.ts +47 -0
  213. package/types/displaynames.d.ts.map +1 -0
  214. package/types/displaynames.js +2 -0
  215. package/types/list.d.ts +19 -0
  216. package/types/list.d.ts.map +1 -0
  217. package/types/list.js +2 -0
  218. package/types/number.d.ts +147 -0
  219. package/types/number.d.ts.map +1 -0
  220. package/types/number.js +2 -0
  221. package/types/plural-rules.d.ts +17 -0
  222. package/types/plural-rules.d.ts.map +1 -0
  223. package/types/plural-rules.js +2 -0
  224. package/types/relative-time.d.ts +41 -0
  225. package/types/relative-time.d.ts.map +1 -0
  226. package/types/relative-time.js +2 -0
  227. package/utils.d.ts +24 -0
  228. package/utils.d.ts.map +1 -0
  229. package/utils.js +90 -0
  230. package/262.ts +0 -372
  231. package/BUILD +0 -97
  232. package/CHANGELOG.md +0 -709
  233. package/CanonicalizeLocaleList.ts +0 -8
  234. package/CanonicalizeTimeZoneName.ts +0 -29
  235. package/CoerceOptionsToObject.ts +0 -13
  236. package/DefaultNumberOption.ts +0 -28
  237. package/GetNumberOption.ts +0 -29
  238. package/GetOption.ts +0 -38
  239. package/GetOptionsObject.ts +0 -14
  240. package/IsSanctionedSimpleUnitIdentifier.ts +0 -66
  241. package/IsValidTimeZoneName.ts +0 -27
  242. package/IsWellFormedCurrencyCode.ts +0 -23
  243. package/IsWellFormedUnitIdentifier.ts +0 -32
  244. package/NumberFormat/ComputeExponent.ts +0 -49
  245. package/NumberFormat/ComputeExponentForMagnitude.ts +0 -71
  246. package/NumberFormat/CurrencyDigits.ts +0 -13
  247. package/NumberFormat/FormatNumericToParts.ts +0 -22
  248. package/NumberFormat/FormatNumericToString.ts +0 -71
  249. package/NumberFormat/InitializeNumberFormat.ts +0 -147
  250. package/NumberFormat/PartitionNumberPattern.ts +0 -86
  251. package/NumberFormat/SetNumberFormatDigitOptions.ts +0 -45
  252. package/NumberFormat/SetNumberFormatUnitOptions.ts +0 -77
  253. package/NumberFormat/ToRawFixed.ts +0 -56
  254. package/NumberFormat/ToRawPrecision.ts +0 -86
  255. package/NumberFormat/digit-mapping.generated.ts +0 -1
  256. package/NumberFormat/format_to_parts.ts +0 -571
  257. package/PartitionPattern.ts +0 -38
  258. package/SupportedLocales.ts +0 -31
  259. package/data.ts +0 -9
  260. package/index.ts +0 -45
  261. package/regex.generated.ts +0 -2
  262. package/scripts/digit-mapping.ts +0 -109
  263. package/scripts/regex-gen.ts +0 -19
  264. package/tests/PartitionPattern.test.ts +0 -38
  265. package/tests/ToRawFixed.test.tsx +0 -41
  266. package/tests/ToRawPrecision.test.tsx +0 -65
  267. package/tsconfig.json +0 -5
  268. package/types/core.ts +0 -11
  269. package/types/date-time.ts +0 -199
  270. package/types/displaynames.ts +0 -48
  271. package/types/list.ts +0 -22
  272. package/types/number.ts +0 -240
  273. package/types/plural-rules.ts +0 -18
  274. package/types/relative-time.ts +0 -74
  275. package/utils.ts +0 -128
@@ -1,2 +0,0 @@
1
- // @generated from regex-gen.ts
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]/
@@ -1,109 +0,0 @@
1
- import minimist, {ParsedArgs} from 'minimist'
2
- import {outputFileSync} from 'fs-extra'
3
-
4
- // Generate an array of 10 characters with consecutive codepoint, starting from `starCharCode`.
5
- function generateDigitChars(startCharCode: number): string[] {
6
- const arr = new Array<string>(10)
7
- for (let i = 0; i < 10; i++) {
8
- arr[i] = String.fromCodePoint(startCharCode + i)
9
- }
10
- return arr
11
- }
12
-
13
- // https://tc39.es/ecma402/#table-numbering-system-digits
14
- const digitMapping: Record<string, string[]> = {
15
- adlm: generateDigitChars(0x1e950),
16
- ahom: generateDigitChars(0x11730),
17
- arab: generateDigitChars(0x660),
18
- arabext: generateDigitChars(0x6f0),
19
- bali: generateDigitChars(0x1b50),
20
- beng: generateDigitChars(0x9e6),
21
- bhks: generateDigitChars(0x11c50),
22
- brah: generateDigitChars(0x11066),
23
- cakm: generateDigitChars(0x11136),
24
- cham: generateDigitChars(0xaa50),
25
- deva: generateDigitChars(0x966),
26
- diak: generateDigitChars(0x11950),
27
- fullwide: generateDigitChars(0xff10),
28
- gong: generateDigitChars(0x11da0),
29
- gonm: generateDigitChars(0x11d50),
30
- gujr: generateDigitChars(0xae6),
31
- guru: generateDigitChars(0xa66),
32
- hanidec: [
33
- '\u3007',
34
- '\u4e00',
35
- '\u4e8c',
36
- '\u4e09',
37
- '\u56db',
38
- '\u4e94',
39
- '\u516d',
40
- '\u4e03',
41
- '\u516b',
42
- '\u4e5d',
43
- ],
44
- hmng: generateDigitChars(0x16b50),
45
- hmnp: generateDigitChars(0x1e140),
46
- java: generateDigitChars(0xa9d0),
47
- kali: generateDigitChars(0xa900),
48
- khmr: generateDigitChars(0x17e0),
49
- knda: generateDigitChars(0xce6),
50
- lana: generateDigitChars(0x1a80),
51
- lanatham: generateDigitChars(0x1a90),
52
- laoo: generateDigitChars(0xed0),
53
- lepc: generateDigitChars(0x1a90),
54
- limb: generateDigitChars(0x1946),
55
- mathbold: generateDigitChars(0x1d7ce),
56
- mathdbl: generateDigitChars(0x1d7d8),
57
- mathmono: generateDigitChars(0x1d7f6),
58
- mathsanb: generateDigitChars(0x1d7ec),
59
- mathsans: generateDigitChars(0x1d7e2),
60
- mlym: generateDigitChars(0xd66),
61
- modi: generateDigitChars(0x11650),
62
- mong: generateDigitChars(0x1810),
63
- mroo: generateDigitChars(0x16a60),
64
- mtei: generateDigitChars(0xabf0),
65
- mymr: generateDigitChars(0x1040),
66
- mymrshan: generateDigitChars(0x1090),
67
- mymrtlng: generateDigitChars(0xa9f0),
68
- newa: generateDigitChars(0x11450),
69
- nkoo: generateDigitChars(0x07c0),
70
- olck: generateDigitChars(0x1c50),
71
- orya: generateDigitChars(0xb66),
72
- osma: generateDigitChars(0x104a0),
73
- rohg: generateDigitChars(0x10d30),
74
- saur: generateDigitChars(0xa8d0),
75
- segment: generateDigitChars(0x1fbf0),
76
- shrd: generateDigitChars(0x111d0),
77
- sind: generateDigitChars(0x112f0),
78
- sinh: generateDigitChars(0x0de6),
79
- sora: generateDigitChars(0x110f0),
80
- sund: generateDigitChars(0x1bb0),
81
- takr: generateDigitChars(0x116c0),
82
- talu: generateDigitChars(0x19d0),
83
- tamldec: generateDigitChars(0xbe6),
84
- telu: generateDigitChars(0xc66),
85
- thai: generateDigitChars(0xe50),
86
- tibt: generateDigitChars(0xf20),
87
- tirh: generateDigitChars(0x114d0),
88
- vaii: generateDigitChars(0x1620),
89
- wara: generateDigitChars(0x118e0),
90
- wcho: generateDigitChars(0x1e2f0),
91
- }
92
-
93
- interface Args extends ParsedArgs {
94
- out: string
95
- }
96
-
97
- function main(args: Args) {
98
- const {out} = args
99
- outputFileSync(
100
- out,
101
- `export const digitMapping: Record<string, ReadonlyArray<string>> = ${JSON.stringify(
102
- digitMapping
103
- )};`
104
- )
105
- }
106
-
107
- if (require.main === module) {
108
- main(minimist<Args>(process.argv))
109
- }
@@ -1,19 +0,0 @@
1
- import regenerate from 'regenerate'
2
- import {outputFileSync} from 'fs-extra'
3
- import minimist from 'minimist'
4
-
5
- function main(args: minimist.ParsedArgs) {
6
- const symbolSeparator = regenerate().add(
7
- require('@unicode/unicode-13.0.0/General_Category/Symbol/code-points.js')
8
- )
9
- outputFileSync(
10
- args.out,
11
- `// @generated from regex-gen.ts
12
- export const S_UNICODE_REGEX = /${symbolSeparator.toString()}/
13
- `
14
- )
15
- }
16
-
17
- if (require.main === module) {
18
- main(minimist(process.argv))
19
- }
@@ -1,38 +0,0 @@
1
- import {PartitionPattern} from '../PartitionPattern'
2
-
3
- test('PartitionPattern should partition pattern correctly', function () {
4
- expect(PartitionPattern('AA{0}BB')).toEqual([
5
- {
6
- type: 'literal',
7
- value: 'AA',
8
- },
9
- {
10
- type: '0',
11
- value: undefined,
12
- },
13
- {
14
- type: 'literal',
15
- value: 'BB',
16
- },
17
- ])
18
- expect(PartitionPattern('{0} BB')).toEqual([
19
- {
20
- type: '0',
21
- value: undefined,
22
- },
23
- {
24
- type: 'literal',
25
- value: ' BB',
26
- },
27
- ])
28
- expect(PartitionPattern('AA {0}')).toEqual([
29
- {
30
- type: 'literal',
31
- value: 'AA ',
32
- },
33
- {
34
- type: '0',
35
- value: undefined,
36
- },
37
- ])
38
- })
@@ -1,41 +0,0 @@
1
- import {ToRawFixed} from '../NumberFormat/ToRawFixed'
2
-
3
- test('ToRawFixed(9.99, 0, 1)', () => {
4
- expect(ToRawFixed(9.99, 0, 1)).toEqual({
5
- formattedString: '10',
6
- roundedNumber: 10,
7
- integerDigitsCount: 2,
8
- })
9
- })
10
-
11
- test('ToRawFixed(1e41, 0, 3)', () => {
12
- expect(ToRawFixed(1e41, 0, 3)).toEqual({
13
- formattedString: '100000000000000000000000000000000000000000',
14
- roundedNumber: 1e41,
15
- integerDigitsCount: 42,
16
- })
17
- })
18
-
19
- test('ToRawFixed(1e-10, 1, 21)', () => {
20
- expect(ToRawFixed(1e-10, 1, 21)).toEqual({
21
- formattedString: '0.0000000001',
22
- roundedNumber: 1e-10,
23
- integerDigitsCount: 1,
24
- })
25
- })
26
-
27
- test('Rounding: ToRawFixed(123.445, 0, 2)', () => {
28
- expect(ToRawFixed(123.445, 0, 2)).toEqual({
29
- formattedString: '123.45',
30
- roundedNumber: 123.45,
31
- integerDigitsCount: 3,
32
- })
33
- })
34
-
35
- it('ToRawFixed(1.2344501e+34, 1, 3)', () => {
36
- expect(ToRawFixed(1.2344501e34, 1, 3)).toEqual({
37
- formattedString: '12344501000000000000000000000000000.0',
38
- roundedNumber: 1.2344501e34,
39
- integerDigitsCount: 35,
40
- })
41
- })
@@ -1,65 +0,0 @@
1
- import {ToRawPrecision} from '../NumberFormat/ToRawPrecision'
2
-
3
- it('ToRawPrecision(9.99, 1, 2)', () => {
4
- expect(ToRawPrecision(9.99, 1, 2)).toEqual({
5
- formattedString: '10',
6
- roundedNumber: 10,
7
- integerDigitsCount: 2,
8
- })
9
- })
10
-
11
- it('ToRawPrecision(9.95, 1, 2)', () => {
12
- expect(ToRawPrecision(9.95, 1, 2)).toEqual({
13
- formattedString: '10',
14
- roundedNumber: 10,
15
- integerDigitsCount: 2,
16
- })
17
- })
18
-
19
- it('ToRawPrecision(9.94, 1, 2)', () => {
20
- expect(ToRawPrecision(9.94, 1, 2)).toEqual({
21
- formattedString: '9.9',
22
- roundedNumber: 9.9,
23
- integerDigitsCount: 1,
24
- })
25
- })
26
-
27
- it('ToRawPrecision(1e41, 1, 21)', () => {
28
- expect(ToRawPrecision(1e41, 1, 21)).toEqual({
29
- formattedString: '100000000000000000000000000000000000000000',
30
- roundedNumber: 1e41,
31
- integerDigitsCount: 42,
32
- })
33
- })
34
-
35
- it('toRawPrecison(1e-10, 1, 21)', () => {
36
- expect(ToRawPrecision(1e-10, 1, 21)).toEqual({
37
- formattedString: '0.0000000001',
38
- roundedNumber: 1e-10,
39
- integerDigitsCount: 1,
40
- })
41
- })
42
-
43
- it('ToRawPrecision(1e21, 1, 10)', () => {
44
- expect(ToRawPrecision(1e21, 1, 10)).toEqual({
45
- formattedString: '1000000000000000000000',
46
- roundedNumber: 1e21,
47
- integerDigitsCount: 22,
48
- })
49
- })
50
-
51
- it('Rounding: ToRawPrecision(123.445, 3, 5)', () => {
52
- expect(ToRawPrecision(123.445, 3, 5)).toEqual({
53
- formattedString: '123.45',
54
- roundedNumber: 123.45,
55
- integerDigitsCount: 3,
56
- })
57
- })
58
-
59
- it('ToRawPrecision(1.1, 3, 5)', () => {
60
- expect(ToRawPrecision(1.1, 3, 5)).toEqual({
61
- formattedString: '1.10',
62
- roundedNumber: 1.1,
63
- integerDigitsCount: 1,
64
- })
65
- })
package/tsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- // @generated
2
- {
3
- // This is purely for IDE, not for compilation
4
- "extends": "../../tsconfig.json"
5
- }
package/types/core.ts DELETED
@@ -1,11 +0,0 @@
1
- export type Locale = string
2
- export interface LocaleData<T> {
3
- data: T
4
- locale: Locale
5
- }
6
-
7
- export interface LookupMatcherResult {
8
- locale: string
9
- extension?: string
10
- nu?: string
11
- }
@@ -1,199 +0,0 @@
1
- export type Formats = Pick<
2
- Intl.DateTimeFormatOptions,
3
- | 'weekday'
4
- | 'era'
5
- | 'year'
6
- | 'month'
7
- | 'day'
8
- | 'hour'
9
- | 'minute'
10
- | 'second'
11
- | 'timeZoneName'
12
- > & {
13
- fractionalSecondDigits?: 0 | 1 | 2
14
- hour12?: boolean
15
- pattern: string
16
- pattern12: string
17
- skeleton: string
18
- rawPattern: string
19
- rangePatterns: Record<TABLE_2 | 'default', RangePatterns>
20
- rangePatterns12: Record<TABLE_2 | 'default', RangePatterns>
21
- }
22
-
23
- export interface IntlDateTimeFormatInternal {
24
- locale: string
25
- dataLocale: string
26
- calendar?: string
27
- dateStyle?: 'full' | 'long' | 'medium' | 'short'
28
- timeStyle?: 'full' | 'long' | 'medium' | 'short'
29
- weekday: 'narrow' | 'short' | 'long'
30
- era: 'narrow' | 'short' | 'long'
31
- year: '2-digit' | 'numeric'
32
- month: '2-digit' | 'numeric' | 'narrow' | 'short' | 'long'
33
- day: '2-digit' | 'numeric'
34
- dayPeriod: 'narrow' | 'short' | 'long'
35
- hour: '2-digit' | 'numeric'
36
- minute: '2-digit' | 'numeric'
37
- second: '2-digit' | 'numeric'
38
- timeZoneName: 'short' | 'long'
39
- fractionalSecondDigits?: 1 | 2 | 3
40
- hourCycle: string
41
- numberingSystem: string
42
- timeZone: string
43
- pattern: string
44
- format: Formats
45
- rangePatterns: Record<TABLE_2 | 'default', RangePatterns>
46
- boundFormat?: Intl.DateTimeFormat['format']
47
- }
48
-
49
- export interface RangePatternPart<
50
- T extends RangePatternType = RangePatternType
51
- > {
52
- source: T
53
- pattern: string
54
- }
55
-
56
- export type RangePatterns = Pick<
57
- Intl.DateTimeFormatOptions,
58
- | 'weekday'
59
- | 'era'
60
- | 'year'
61
- | 'month'
62
- | 'day'
63
- | 'hour'
64
- | 'minute'
65
- | 'second'
66
- | 'timeZoneName'
67
- > & {
68
- hour12?: boolean
69
- patternParts: Array<RangePatternPart>
70
- }
71
-
72
- export enum RangePatternType {
73
- startRange = 'startRange',
74
- shared = 'shared',
75
- endRange = 'endRange',
76
- }
77
-
78
- export type TABLE_6 =
79
- | 'weekday'
80
- | 'era'
81
- | 'year'
82
- | 'month'
83
- | 'day'
84
- | 'hour'
85
- | 'minute'
86
- | 'second'
87
- | 'fractionalSecondDigits'
88
- | 'timeZoneName'
89
-
90
- export type TABLE_2 =
91
- | 'era'
92
- | 'year'
93
- | 'month'
94
- | 'day'
95
- | 'dayPeriod'
96
- | 'ampm'
97
- | 'hour'
98
- | 'minute'
99
- | 'second'
100
- | 'fractionalSecondDigits'
101
-
102
- export type TimeZoneNameData = Record<
103
- string,
104
- {
105
- long?: [string, string]
106
- short?: [string, string]
107
- }
108
- >
109
-
110
- export interface EraData {
111
- BC: string
112
- AD: string
113
- }
114
-
115
- export interface DateTimeFormatLocaleInternalData {
116
- am: string
117
- pm: string
118
- weekday: {
119
- narrow: string[]
120
- long: string[]
121
- short: string[]
122
- }
123
- era: {
124
- narrow: EraData
125
- long: EraData
126
- short: EraData
127
- }
128
- month: {
129
- narrow: string[]
130
- long: string[]
131
- short: string[]
132
- }
133
- timeZoneName: TimeZoneNameData
134
- /**
135
- * So we can construct GMT+08:00
136
- */
137
- gmtFormat: string
138
- /**
139
- * So we can construct GMT+08:00
140
- */
141
- hourFormat: string
142
- hourCycle: string
143
- dateFormat: {full: Formats; long: Formats; medium: Formats; short: Formats}
144
- timeFormat: {full: Formats; long: Formats; medium: Formats; short: Formats}
145
- dateTimeFormat: {full: string; long: string; medium: string; short: string}
146
- formats: Record<string, Formats[]>
147
- nu: string[]
148
- hc: string[]
149
- ca: string[]
150
- }
151
-
152
- export type IntervalFormatsData = {
153
- intervalFormatFallback: string
154
- } & Record<string, Record<string, string>>
155
-
156
- export interface DateTimeFormat
157
- extends Omit<
158
- Intl.DateTimeFormat,
159
- 'resolvedOptions' | 'formatRange' | 'formatRangeToParts'
160
- > {
161
- resolvedOptions(): ResolvedDateTimeFormatOptions
162
- formatRange(startDate: number | Date, endDate: number | Date): string
163
- formatRangeToParts(
164
- startDate: number | Date,
165
- endDate: number | Date
166
- ): IntlDateTimeFormatPart[]
167
- }
168
-
169
- export interface ResolvedDateTimeFormatOptions
170
- extends Intl.ResolvedDateTimeFormatOptions {
171
- dateStyle?: 'full' | 'long' | 'medium' | 'short'
172
- timeStyle?: 'full' | 'long' | 'medium' | 'short'
173
- numberingSystem: string
174
- }
175
-
176
- export type UnpackedZoneData = [
177
- // Seconds from UTC Time, -Infinity if NULL
178
- number,
179
- // abbrvs like EST/EDT
180
- string,
181
- // offsets in seconds
182
- number,
183
- // Whether it's daylight, 0|1
184
- boolean
185
- ]
186
-
187
- export type IntlDateTimeFormatPartType =
188
- | Intl.DateTimeFormatPartTypes
189
- | 'ampm'
190
- | 'relatedYear'
191
- | 'yearName'
192
- | 'unknown'
193
- | 'fractionalSecondDigits'
194
-
195
- export interface IntlDateTimeFormatPart {
196
- type: IntlDateTimeFormatPartType
197
- value: string | undefined
198
- source?: RangePatternType
199
- }
@@ -1,48 +0,0 @@
1
- import {LocaleData} from './core'
2
-
3
- type LanguageTag = string
4
- type RegionCode = string
5
- type ScriptCode = string
6
- type CurrencyCode = string
7
-
8
- export interface DisplayNamesData {
9
- /**
10
- * Note that for style fields, `short` and `narrow` might not exist.
11
- * At runtime, the fallback order will be narrow -> short -> long.
12
- */
13
- types: {
14
- /**
15
- * Maps language subtag like `zh-CN` to their display names.
16
- */
17
- language: {
18
- narrow: Record<LanguageTag, string>
19
- short: Record<LanguageTag, string>
20
- long: Record<LanguageTag, string>
21
- }
22
- region: {
23
- narrow: Record<RegionCode, string>
24
- short: Record<RegionCode, string>
25
- long: Record<RegionCode, string>
26
- }
27
- script: {
28
- narrow: Record<ScriptCode, string>
29
- short: Record<ScriptCode, string>
30
- long: Record<ScriptCode, string>
31
- }
32
- currency: {
33
- narrow: Record<CurrencyCode, string>
34
- short: Record<CurrencyCode, string>
35
- long: Record<CurrencyCode, string>
36
- }
37
- }
38
- /**
39
- * Not in spec, but we need this to display both language and region in display name.
40
- * e.g. zh-Hans-SG + "{0}({1})" -> 简体中文(新加坡)
41
- * Here {0} is replaced by language display name and {1} is replaced by region display name.
42
- */
43
- patterns: {
44
- locale: string
45
- }
46
- }
47
-
48
- export type DisplayNamesLocaleData = LocaleData<DisplayNamesData>
package/types/list.ts DELETED
@@ -1,22 +0,0 @@
1
- import {LocaleData} from './core'
2
-
3
- export type ListPatternLocaleData = LocaleData<ListPatternFieldsData>
4
-
5
- export interface ListPatternFieldsData {
6
- conjunction?: ListPatternData
7
- disjunction?: ListPatternData
8
- unit?: ListPatternData
9
- }
10
-
11
- export interface ListPattern {
12
- start: string
13
- middle: string
14
- end: string
15
- pair: string
16
- }
17
-
18
- export interface ListPatternData {
19
- long: ListPattern
20
- short?: ListPattern
21
- narrow?: ListPattern
22
- }