@formatjs/ecma402-abstract 1.2.6 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (468) hide show
  1. package/{lib/src/BestAvailableLocale.d.ts → BestAvailableLocale.d.ts} +0 -0
  2. package/BestAvailableLocale.d.ts.map +1 -0
  3. package/{src/BestAvailableLocale.js → BestAvailableLocale.js} +0 -0
  4. package/{src/BestFitMatcher.d.ts → BestFitMatcher.d.ts} +1 -1
  5. package/BestFitMatcher.d.ts.map +1 -0
  6. package/{src/BestFitMatcher.js → BestFitMatcher.js} +0 -0
  7. package/{lib/src/CanonicalizeLocaleList.d.ts → CanonicalizeLocaleList.d.ts} +0 -0
  8. package/CanonicalizeLocaleList.d.ts.map +1 -0
  9. package/{src/CanonicalizeLocaleList.js → CanonicalizeLocaleList.js} +0 -0
  10. package/{lib/src/CanonicalizeTimeZoneName.d.ts → CanonicalizeTimeZoneName.d.ts} +0 -0
  11. package/CanonicalizeTimeZoneName.d.ts.map +1 -0
  12. package/{src/CanonicalizeTimeZoneName.js → CanonicalizeTimeZoneName.js} +0 -0
  13. package/{lib/src/DateTimeFormat → DateTimeFormat}/BasicFormatMatcher.d.ts +1 -1
  14. package/DateTimeFormat/BasicFormatMatcher.d.ts.map +1 -0
  15. package/{src/DateTimeFormat → DateTimeFormat}/BasicFormatMatcher.js +0 -0
  16. package/{lib/src/DateTimeFormat → DateTimeFormat}/BestFitFormatMatcher.d.ts +1 -1
  17. package/DateTimeFormat/BestFitFormatMatcher.d.ts.map +1 -0
  18. package/{src/DateTimeFormat → DateTimeFormat}/BestFitFormatMatcher.js +9 -2
  19. package/{lib/src/DateTimeFormat → DateTimeFormat}/DateTimeStyleFormat.d.ts +1 -1
  20. package/DateTimeFormat/DateTimeStyleFormat.d.ts.map +1 -0
  21. package/{src/DateTimeFormat → DateTimeFormat}/DateTimeStyleFormat.js +0 -0
  22. package/{lib/src/DateTimeFormat → DateTimeFormat}/FormatDateTime.d.ts +0 -0
  23. package/DateTimeFormat/FormatDateTime.d.ts.map +1 -0
  24. package/{src/DateTimeFormat → DateTimeFormat}/FormatDateTime.js +0 -0
  25. package/DateTimeFormat/FormatDateTimePattern.d.ts +14 -0
  26. package/DateTimeFormat/FormatDateTimePattern.d.ts.map +1 -0
  27. package/{src/DateTimeFormat/PartitionDateTimePattern.js → DateTimeFormat/FormatDateTimePattern.js} +4 -16
  28. package/DateTimeFormat/FormatDateTimeRange.d.ts +4 -0
  29. package/DateTimeFormat/FormatDateTimeRange.d.ts.map +1 -0
  30. package/DateTimeFormat/FormatDateTimeRange.js +14 -0
  31. package/DateTimeFormat/FormatDateTimeRangeToParts.d.ts +4 -0
  32. package/DateTimeFormat/FormatDateTimeRangeToParts.d.ts.map +1 -0
  33. package/DateTimeFormat/FormatDateTimeRangeToParts.js +18 -0
  34. package/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.d.ts +2 -1
  35. package/DateTimeFormat/FormatDateTimeToParts.d.ts.map +1 -0
  36. package/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.js +1 -1
  37. package/{lib/src/DateTimeFormat → DateTimeFormat}/InitializeDateTimeFormat.d.ts +1 -1
  38. package/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +1 -0
  39. package/{src/DateTimeFormat → DateTimeFormat}/InitializeDateTimeFormat.js +39 -27
  40. package/DateTimeFormat/PartitionDateTimePattern.d.ts +10 -0
  41. package/DateTimeFormat/PartitionDateTimePattern.d.ts.map +1 -0
  42. package/DateTimeFormat/PartitionDateTimePattern.js +24 -0
  43. package/DateTimeFormat/PartitionDateTimeRangePattern.d.ts +5 -0
  44. package/DateTimeFormat/PartitionDateTimeRangePattern.d.ts.map +1 -0
  45. package/DateTimeFormat/PartitionDateTimeRangePattern.js +103 -0
  46. package/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.d.ts +1 -1
  47. package/DateTimeFormat/ToDateTimeOptions.d.ts.map +1 -0
  48. package/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.js +1 -1
  49. package/{lib/src/DateTimeFormat → DateTimeFormat}/ToLocalTime.d.ts +5 -4
  50. package/DateTimeFormat/ToLocalTime.d.ts.map +1 -0
  51. package/{src/DateTimeFormat → DateTimeFormat}/ToLocalTime.js +1 -1
  52. package/DateTimeFormat/skeleton.d.ts +14 -0
  53. package/DateTimeFormat/skeleton.d.ts.map +1 -0
  54. package/{src/DateTimeFormat → DateTimeFormat}/skeleton.js +160 -29
  55. package/{lib/src/DateTimeFormat → DateTimeFormat}/utils.d.ts +1 -1
  56. package/DateTimeFormat/utils.d.ts.map +1 -0
  57. package/{src/DateTimeFormat → DateTimeFormat}/utils.js +0 -0
  58. package/{lib/src/DefaultNumberOption.d.ts → DefaultNumberOption.d.ts} +0 -0
  59. package/DefaultNumberOption.d.ts.map +1 -0
  60. package/{src/DefaultNumberOption.js → DefaultNumberOption.js} +0 -0
  61. package/{lib/src/DisplayNames → DisplayNames}/CanonicalCodeForDisplayNames.d.ts +0 -0
  62. package/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +1 -0
  63. package/{src/DisplayNames → DisplayNames}/CanonicalCodeForDisplayNames.js +0 -0
  64. package/{lib/src/GetNumberOption.d.ts → GetNumberOption.d.ts} +0 -0
  65. package/GetNumberOption.d.ts.map +1 -0
  66. package/{src/GetNumberOption.js → GetNumberOption.js} +0 -0
  67. package/{lib/src/GetOption.d.ts → GetOption.d.ts} +0 -0
  68. package/GetOption.d.ts.map +1 -0
  69. package/{src/GetOption.js → GetOption.js} +1 -1
  70. package/{lib/src/IsSanctionedSimpleUnitIdentifier.d.ts → IsSanctionedSimpleUnitIdentifier.d.ts} +0 -0
  71. package/IsSanctionedSimpleUnitIdentifier.d.ts.map +1 -0
  72. package/{src/IsSanctionedSimpleUnitIdentifier.js → IsSanctionedSimpleUnitIdentifier.js} +0 -0
  73. package/{lib/src/IsValidTimeZoneName.d.ts → IsValidTimeZoneName.d.ts} +0 -0
  74. package/IsValidTimeZoneName.d.ts.map +1 -0
  75. package/{src/IsValidTimeZoneName.js → IsValidTimeZoneName.js} +0 -0
  76. package/{lib/src/IsWellFormedCurrencyCode.d.ts → IsWellFormedCurrencyCode.d.ts} +0 -0
  77. package/IsWellFormedCurrencyCode.d.ts.map +1 -0
  78. package/{src/IsWellFormedCurrencyCode.js → IsWellFormedCurrencyCode.js} +0 -0
  79. package/{lib/src/IsWellFormedUnitIdentifier.d.ts → IsWellFormedUnitIdentifier.d.ts} +0 -0
  80. package/IsWellFormedUnitIdentifier.d.ts.map +1 -0
  81. package/{src/IsWellFormedUnitIdentifier.js → IsWellFormedUnitIdentifier.js} +0 -0
  82. package/{src/LookupMatcher.d.ts → LookupMatcher.d.ts} +1 -1
  83. package/LookupMatcher.d.ts.map +1 -0
  84. package/{src/LookupMatcher.js → LookupMatcher.js} +0 -0
  85. package/{lib/src/LookupSupportedLocales.d.ts → LookupSupportedLocales.d.ts} +0 -0
  86. package/LookupSupportedLocales.d.ts.map +1 -0
  87. package/{src/LookupSupportedLocales.js → LookupSupportedLocales.js} +0 -0
  88. package/{lib/src/NumberFormat → NumberFormat}/ComputeExponent.d.ts +1 -1
  89. package/NumberFormat/ComputeExponent.d.ts.map +1 -0
  90. package/{src/NumberFormat → NumberFormat}/ComputeExponent.js +0 -0
  91. package/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.d.ts +1 -1
  92. package/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
  93. package/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.js +0 -0
  94. package/{lib/src/NumberFormat → NumberFormat}/CurrencyDigits.d.ts +0 -0
  95. package/NumberFormat/CurrencyDigits.d.ts.map +1 -0
  96. package/{src/NumberFormat → NumberFormat}/CurrencyDigits.js +1 -1
  97. package/{src/NumberFormat → NumberFormat}/FormatNumericToParts.d.ts +1 -1
  98. package/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
  99. package/{src/NumberFormat → NumberFormat}/FormatNumericToParts.js +1 -1
  100. package/{src/NumberFormat → NumberFormat}/FormatNumericToString.d.ts +1 -1
  101. package/NumberFormat/FormatNumericToString.d.ts.map +1 -0
  102. package/{src/NumberFormat → NumberFormat}/FormatNumericToString.js +1 -1
  103. package/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.d.ts +1 -1
  104. package/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
  105. package/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.js +1 -1
  106. package/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.d.ts +2 -2
  107. package/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
  108. package/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.js +1 -1
  109. package/{lib/src/NumberFormat → NumberFormat}/SetNumberFormatDigitOptions.d.ts +1 -1
  110. package/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +1 -0
  111. package/{src/NumberFormat → NumberFormat}/SetNumberFormatDigitOptions.js +0 -0
  112. package/{lib/src/NumberFormat → NumberFormat}/SetNumberFormatUnitOptions.d.ts +1 -1
  113. package/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
  114. package/{src/NumberFormat → NumberFormat}/SetNumberFormatUnitOptions.js +0 -0
  115. package/{lib/src/NumberFormat → NumberFormat}/ToRawFixed.d.ts +1 -1
  116. package/NumberFormat/ToRawFixed.d.ts.map +1 -0
  117. package/{src/NumberFormat → NumberFormat}/ToRawFixed.js +0 -0
  118. package/{lib/src/NumberFormat → NumberFormat}/ToRawPrecision.d.ts +1 -1
  119. package/NumberFormat/ToRawPrecision.d.ts.map +1 -0
  120. package/{src/NumberFormat → NumberFormat}/ToRawPrecision.js +0 -0
  121. package/{lib/src/NumberFormat → NumberFormat}/digit-mapping.json +0 -0
  122. package/{lib/src/NumberFormat → NumberFormat}/format_to_parts.d.ts +1 -1
  123. package/NumberFormat/format_to_parts.d.ts.map +1 -0
  124. package/{src/NumberFormat → NumberFormat}/format_to_parts.js +0 -0
  125. package/PartitionPattern.d.ts +9 -0
  126. package/PartitionPattern.d.ts.map +1 -0
  127. package/{src/PartitionPattern.js → PartitionPattern.js} +0 -0
  128. package/{lib/src/PluralRules → PluralRules}/GetOperands.d.ts +0 -0
  129. package/PluralRules/GetOperands.d.ts.map +1 -0
  130. package/{src/PluralRules → PluralRules}/GetOperands.js +1 -1
  131. package/{lib/src/PluralRules → PluralRules}/InitializePluralRules.d.ts +1 -1
  132. package/PluralRules/InitializePluralRules.d.ts.map +1 -0
  133. package/{src/PluralRules → PluralRules}/InitializePluralRules.js +1 -1
  134. package/{lib/src/PluralRules → PluralRules}/ResolvePlural.d.ts +1 -1
  135. package/PluralRules/ResolvePlural.d.ts.map +1 -0
  136. package/{src/PluralRules → PluralRules}/ResolvePlural.js +1 -1
  137. package/README.md +4 -2
  138. package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTime.d.ts +1 -1
  139. package/RelativeTimeFormat/FormatRelativeTime.d.ts.map +1 -0
  140. package/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTime.js +0 -0
  141. package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTimeToParts.d.ts +1 -1
  142. package/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +1 -0
  143. package/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTimeToParts.js +1 -1
  144. package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/InitializeRelativeTimeFormat.d.ts +1 -1
  145. package/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +1 -0
  146. package/{src/RelativeTimeFormat → RelativeTimeFormat}/InitializeRelativeTimeFormat.js +1 -1
  147. package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/MakePartsList.d.ts +1 -1
  148. package/RelativeTimeFormat/MakePartsList.d.ts.map +1 -0
  149. package/{src/RelativeTimeFormat → RelativeTimeFormat}/MakePartsList.js +0 -0
  150. package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/PartitionRelativeTimePattern.d.ts +1 -1
  151. package/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +1 -0
  152. package/{src/RelativeTimeFormat → RelativeTimeFormat}/PartitionRelativeTimePattern.js +1 -1
  153. package/{lib/src/RelativeTimeFormat → RelativeTimeFormat}/SingularRelativeTimeUnit.d.ts +1 -1
  154. package/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +1 -0
  155. package/{src/RelativeTimeFormat → RelativeTimeFormat}/SingularRelativeTimeUnit.js +1 -1
  156. package/{lib/src/ResolveLocale.d.ts → ResolveLocale.d.ts} +0 -0
  157. package/ResolveLocale.d.ts.map +1 -0
  158. package/{src/ResolveLocale.js → ResolveLocale.js} +0 -0
  159. package/{lib/src/SupportedLocales.d.ts → SupportedLocales.d.ts} +0 -0
  160. package/SupportedLocales.d.ts.map +1 -0
  161. package/{src/SupportedLocales.js → SupportedLocales.js} +1 -1
  162. package/{lib/src/UnicodeExtensionValue.d.ts → UnicodeExtensionValue.d.ts} +0 -0
  163. package/UnicodeExtensionValue.d.ts.map +1 -0
  164. package/{src/UnicodeExtensionValue.js → UnicodeExtensionValue.js} +0 -0
  165. package/{lib/src/data.d.ts → data.d.ts} +1 -1
  166. package/data.d.ts.map +1 -0
  167. package/{src/data.js → data.js} +0 -0
  168. package/index.d.ts +48 -46
  169. package/index.d.ts.map +1 -1
  170. package/index.js +48 -46
  171. package/{src → lib}/BestAvailableLocale.d.ts +0 -0
  172. package/lib/BestAvailableLocale.d.ts.map +1 -0
  173. package/lib/{src/BestAvailableLocale.js → BestAvailableLocale.js} +0 -0
  174. package/lib/{src/BestFitMatcher.d.ts → BestFitMatcher.d.ts} +1 -1
  175. package/lib/BestFitMatcher.d.ts.map +1 -0
  176. package/lib/{src/BestFitMatcher.js → BestFitMatcher.js} +0 -0
  177. package/{src → lib}/CanonicalizeLocaleList.d.ts +0 -0
  178. package/lib/CanonicalizeLocaleList.d.ts.map +1 -0
  179. package/lib/{src/CanonicalizeLocaleList.js → CanonicalizeLocaleList.js} +0 -0
  180. package/{src → lib}/CanonicalizeTimeZoneName.d.ts +0 -0
  181. package/lib/CanonicalizeTimeZoneName.d.ts.map +1 -0
  182. package/lib/{src/CanonicalizeTimeZoneName.js → CanonicalizeTimeZoneName.js} +0 -0
  183. package/{src → lib}/DateTimeFormat/BasicFormatMatcher.d.ts +1 -1
  184. package/lib/DateTimeFormat/BasicFormatMatcher.d.ts.map +1 -0
  185. package/lib/{src/DateTimeFormat → DateTimeFormat}/BasicFormatMatcher.js +0 -0
  186. package/{src → lib}/DateTimeFormat/BestFitFormatMatcher.d.ts +1 -1
  187. package/lib/DateTimeFormat/BestFitFormatMatcher.d.ts.map +1 -0
  188. package/lib/{src/DateTimeFormat → DateTimeFormat}/BestFitFormatMatcher.js +10 -3
  189. package/{src → lib}/DateTimeFormat/DateTimeStyleFormat.d.ts +1 -1
  190. package/lib/DateTimeFormat/DateTimeStyleFormat.d.ts.map +1 -0
  191. package/lib/{src/DateTimeFormat → DateTimeFormat}/DateTimeStyleFormat.js +0 -0
  192. package/{src → lib}/DateTimeFormat/FormatDateTime.d.ts +0 -0
  193. package/lib/DateTimeFormat/FormatDateTime.d.ts.map +1 -0
  194. package/lib/{src/DateTimeFormat → DateTimeFormat}/FormatDateTime.js +0 -0
  195. package/lib/DateTimeFormat/FormatDateTimePattern.d.ts +14 -0
  196. package/lib/DateTimeFormat/FormatDateTimePattern.d.ts.map +1 -0
  197. package/lib/{src/DateTimeFormat/PartitionDateTimePattern.js → DateTimeFormat/FormatDateTimePattern.js} +2 -14
  198. package/lib/DateTimeFormat/FormatDateTimeRange.d.ts +4 -0
  199. package/lib/DateTimeFormat/FormatDateTimeRange.d.ts.map +1 -0
  200. package/lib/DateTimeFormat/FormatDateTimeRange.js +10 -0
  201. package/lib/DateTimeFormat/FormatDateTimeRangeToParts.d.ts +4 -0
  202. package/lib/DateTimeFormat/FormatDateTimeRangeToParts.d.ts.map +1 -0
  203. package/lib/DateTimeFormat/FormatDateTimeRangeToParts.js +14 -0
  204. package/lib/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.d.ts +2 -1
  205. package/lib/DateTimeFormat/FormatDateTimeToParts.d.ts.map +1 -0
  206. package/lib/{src/DateTimeFormat → DateTimeFormat}/FormatDateTimeToParts.js +1 -1
  207. package/{src → lib}/DateTimeFormat/InitializeDateTimeFormat.d.ts +1 -1
  208. package/lib/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +1 -0
  209. package/lib/{src/DateTimeFormat → DateTimeFormat}/InitializeDateTimeFormat.js +39 -27
  210. package/lib/DateTimeFormat/PartitionDateTimePattern.d.ts +10 -0
  211. package/lib/DateTimeFormat/PartitionDateTimePattern.d.ts.map +1 -0
  212. package/lib/DateTimeFormat/PartitionDateTimePattern.js +20 -0
  213. package/lib/DateTimeFormat/PartitionDateTimeRangePattern.d.ts +5 -0
  214. package/lib/DateTimeFormat/PartitionDateTimeRangePattern.d.ts.map +1 -0
  215. package/lib/DateTimeFormat/PartitionDateTimeRangePattern.js +99 -0
  216. package/lib/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.d.ts +1 -1
  217. package/lib/DateTimeFormat/ToDateTimeOptions.d.ts.map +1 -0
  218. package/lib/{src/DateTimeFormat → DateTimeFormat}/ToDateTimeOptions.js +1 -1
  219. package/{src → lib}/DateTimeFormat/ToLocalTime.d.ts +5 -4
  220. package/lib/DateTimeFormat/ToLocalTime.d.ts.map +1 -0
  221. package/lib/{src/DateTimeFormat → DateTimeFormat}/ToLocalTime.js +1 -1
  222. package/lib/DateTimeFormat/skeleton.d.ts +14 -0
  223. package/lib/DateTimeFormat/skeleton.d.ts.map +1 -0
  224. package/lib/{src/DateTimeFormat → DateTimeFormat}/skeleton.js +156 -28
  225. package/{src → lib}/DateTimeFormat/utils.d.ts +1 -1
  226. package/lib/DateTimeFormat/utils.d.ts.map +1 -0
  227. package/lib/{src/DateTimeFormat → DateTimeFormat}/utils.js +0 -0
  228. package/{src → lib}/DefaultNumberOption.d.ts +0 -0
  229. package/lib/DefaultNumberOption.d.ts.map +1 -0
  230. package/lib/{src/DefaultNumberOption.js → DefaultNumberOption.js} +0 -0
  231. package/{src → lib}/DisplayNames/CanonicalCodeForDisplayNames.d.ts +0 -0
  232. package/lib/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +1 -0
  233. package/lib/{src/DisplayNames → DisplayNames}/CanonicalCodeForDisplayNames.js +0 -0
  234. package/{src → lib}/GetNumberOption.d.ts +0 -0
  235. package/lib/GetNumberOption.d.ts.map +1 -0
  236. package/lib/{src/GetNumberOption.js → GetNumberOption.js} +0 -0
  237. package/{src → lib}/GetOption.d.ts +0 -0
  238. package/lib/GetOption.d.ts.map +1 -0
  239. package/lib/{src/GetOption.js → GetOption.js} +1 -1
  240. package/{src → lib}/IsSanctionedSimpleUnitIdentifier.d.ts +0 -0
  241. package/lib/IsSanctionedSimpleUnitIdentifier.d.ts.map +1 -0
  242. package/lib/{src/IsSanctionedSimpleUnitIdentifier.js → IsSanctionedSimpleUnitIdentifier.js} +0 -0
  243. package/{src → lib}/IsValidTimeZoneName.d.ts +0 -0
  244. package/lib/IsValidTimeZoneName.d.ts.map +1 -0
  245. package/lib/{src/IsValidTimeZoneName.js → IsValidTimeZoneName.js} +0 -0
  246. package/{src → lib}/IsWellFormedCurrencyCode.d.ts +0 -0
  247. package/lib/IsWellFormedCurrencyCode.d.ts.map +1 -0
  248. package/lib/{src/IsWellFormedCurrencyCode.js → IsWellFormedCurrencyCode.js} +0 -0
  249. package/{src → lib}/IsWellFormedUnitIdentifier.d.ts +0 -0
  250. package/lib/IsWellFormedUnitIdentifier.d.ts.map +1 -0
  251. package/lib/{src/IsWellFormedUnitIdentifier.js → IsWellFormedUnitIdentifier.js} +0 -0
  252. package/lib/{src/LookupMatcher.d.ts → LookupMatcher.d.ts} +1 -1
  253. package/lib/LookupMatcher.d.ts.map +1 -0
  254. package/lib/{src/LookupMatcher.js → LookupMatcher.js} +0 -0
  255. package/{src → lib}/LookupSupportedLocales.d.ts +0 -0
  256. package/lib/LookupSupportedLocales.d.ts.map +1 -0
  257. package/lib/{src/LookupSupportedLocales.js → LookupSupportedLocales.js} +0 -0
  258. package/{src → lib}/NumberFormat/ComputeExponent.d.ts +1 -1
  259. package/lib/NumberFormat/ComputeExponent.d.ts.map +1 -0
  260. package/lib/{src/NumberFormat → NumberFormat}/ComputeExponent.js +0 -0
  261. package/lib/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.d.ts +1 -1
  262. package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
  263. package/lib/{src/NumberFormat → NumberFormat}/ComputeExponentForMagnitude.js +0 -0
  264. package/{src → lib}/NumberFormat/CurrencyDigits.d.ts +0 -0
  265. package/lib/NumberFormat/CurrencyDigits.d.ts.map +1 -0
  266. package/lib/{src/NumberFormat → NumberFormat}/CurrencyDigits.js +1 -1
  267. package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToParts.d.ts +1 -1
  268. package/lib/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
  269. package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToParts.js +1 -1
  270. package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToString.d.ts +1 -1
  271. package/lib/NumberFormat/FormatNumericToString.d.ts.map +1 -0
  272. package/lib/{src/NumberFormat → NumberFormat}/FormatNumericToString.js +1 -1
  273. package/lib/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.d.ts +1 -1
  274. package/lib/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
  275. package/lib/{src/NumberFormat → NumberFormat}/InitializeNumberFormat.js +1 -1
  276. package/lib/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.d.ts +2 -2
  277. package/lib/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
  278. package/lib/{src/NumberFormat → NumberFormat}/PartitionNumberPattern.js +1 -1
  279. package/{src → lib}/NumberFormat/SetNumberFormatDigitOptions.d.ts +1 -1
  280. package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +1 -0
  281. package/lib/{src/NumberFormat → NumberFormat}/SetNumberFormatDigitOptions.js +0 -0
  282. package/{src → lib}/NumberFormat/SetNumberFormatUnitOptions.d.ts +1 -1
  283. package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
  284. package/lib/{src/NumberFormat → NumberFormat}/SetNumberFormatUnitOptions.js +0 -0
  285. package/{src → lib}/NumberFormat/ToRawFixed.d.ts +1 -1
  286. package/lib/NumberFormat/ToRawFixed.d.ts.map +1 -0
  287. package/lib/{src/NumberFormat → NumberFormat}/ToRawFixed.js +0 -0
  288. package/{src → lib}/NumberFormat/ToRawPrecision.d.ts +1 -1
  289. package/lib/NumberFormat/ToRawPrecision.d.ts.map +1 -0
  290. package/lib/{src/NumberFormat → NumberFormat}/ToRawPrecision.js +0 -0
  291. package/{src → lib}/NumberFormat/digit-mapping.json +0 -0
  292. package/{src → lib}/NumberFormat/format_to_parts.d.ts +1 -1
  293. package/lib/NumberFormat/format_to_parts.d.ts.map +1 -0
  294. package/lib/{src/NumberFormat → NumberFormat}/format_to_parts.js +0 -0
  295. package/lib/PartitionPattern.d.ts +9 -0
  296. package/lib/PartitionPattern.d.ts.map +1 -0
  297. package/lib/{src/PartitionPattern.js → PartitionPattern.js} +0 -0
  298. package/{src → lib}/PluralRules/GetOperands.d.ts +0 -0
  299. package/lib/PluralRules/GetOperands.d.ts.map +1 -0
  300. package/lib/{src/PluralRules → PluralRules}/GetOperands.js +1 -1
  301. package/{src → lib}/PluralRules/InitializePluralRules.d.ts +1 -1
  302. package/lib/PluralRules/InitializePluralRules.d.ts.map +1 -0
  303. package/lib/{src/PluralRules → PluralRules}/InitializePluralRules.js +1 -1
  304. package/{src → lib}/PluralRules/ResolvePlural.d.ts +1 -1
  305. package/lib/PluralRules/ResolvePlural.d.ts.map +1 -0
  306. package/lib/{src/PluralRules → PluralRules}/ResolvePlural.js +1 -1
  307. package/{src → lib}/RelativeTimeFormat/FormatRelativeTime.d.ts +1 -1
  308. package/lib/RelativeTimeFormat/FormatRelativeTime.d.ts.map +1 -0
  309. package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTime.js +0 -0
  310. package/{src → lib}/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts +1 -1
  311. package/lib/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +1 -0
  312. package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/FormatRelativeTimeToParts.js +1 -1
  313. package/{src → lib}/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts +1 -1
  314. package/lib/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +1 -0
  315. package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/InitializeRelativeTimeFormat.js +1 -1
  316. package/{src → lib}/RelativeTimeFormat/MakePartsList.d.ts +1 -1
  317. package/lib/RelativeTimeFormat/MakePartsList.d.ts.map +1 -0
  318. package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/MakePartsList.js +0 -0
  319. package/{src → lib}/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts +1 -1
  320. package/lib/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +1 -0
  321. package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/PartitionRelativeTimePattern.js +1 -1
  322. package/{src → lib}/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts +1 -1
  323. package/lib/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +1 -0
  324. package/lib/{src/RelativeTimeFormat → RelativeTimeFormat}/SingularRelativeTimeUnit.js +1 -1
  325. package/{src → lib}/ResolveLocale.d.ts +0 -0
  326. package/lib/ResolveLocale.d.ts.map +1 -0
  327. package/lib/{src/ResolveLocale.js → ResolveLocale.js} +0 -0
  328. package/{src → lib}/SupportedLocales.d.ts +0 -0
  329. package/lib/SupportedLocales.d.ts.map +1 -0
  330. package/lib/{src/SupportedLocales.js → SupportedLocales.js} +1 -1
  331. package/{src → lib}/UnicodeExtensionValue.d.ts +0 -0
  332. package/lib/UnicodeExtensionValue.d.ts.map +1 -0
  333. package/lib/{src/UnicodeExtensionValue.js → UnicodeExtensionValue.js} +0 -0
  334. package/{src → lib}/data.d.ts +1 -1
  335. package/lib/data.d.ts.map +1 -0
  336. package/lib/{src/data.js → data.js} +0 -0
  337. package/lib/index.d.ts +48 -46
  338. package/lib/index.d.ts.map +1 -1
  339. package/lib/index.js +48 -46
  340. package/lib/types/date-time.d.ts +29 -0
  341. package/lib/types/date-time.d.ts.map +1 -1
  342. package/lib/types/date-time.js +6 -1
  343. package/lib/types/relative-time.d.ts +1 -1
  344. package/lib/types/relative-time.d.ts.map +1 -1
  345. package/lib/{src/utils.d.ts → utils.d.ts} +0 -0
  346. package/lib/utils.d.ts.map +1 -0
  347. package/lib/{src/utils.js → utils.js} +0 -0
  348. package/package.json +1 -1
  349. package/types/date-time.d.ts +29 -0
  350. package/types/date-time.d.ts.map +1 -1
  351. package/types/date-time.js +7 -0
  352. package/types/relative-time.d.ts +1 -1
  353. package/types/relative-time.d.ts.map +1 -1
  354. package/{src/utils.d.ts → utils.d.ts} +0 -0
  355. package/utils.d.ts.map +1 -0
  356. package/{src/utils.js → utils.js} +0 -0
  357. package/_validate_dist-base_options.optionsvalid.d.ts +0 -9
  358. package/_validate_dist-esm_options.optionsvalid.d.ts +0 -9
  359. package/lib/src/BestAvailableLocale.d.ts.map +0 -1
  360. package/lib/src/BestFitMatcher.d.ts.map +0 -1
  361. package/lib/src/CanonicalizeLocaleList.d.ts.map +0 -1
  362. package/lib/src/CanonicalizeTimeZoneName.d.ts.map +0 -1
  363. package/lib/src/DateTimeFormat/BasicFormatMatcher.d.ts.map +0 -1
  364. package/lib/src/DateTimeFormat/BestFitFormatMatcher.d.ts.map +0 -1
  365. package/lib/src/DateTimeFormat/DateTimeStyleFormat.d.ts.map +0 -1
  366. package/lib/src/DateTimeFormat/FormatDateTime.d.ts.map +0 -1
  367. package/lib/src/DateTimeFormat/FormatDateTimeToParts.d.ts.map +0 -1
  368. package/lib/src/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +0 -1
  369. package/lib/src/DateTimeFormat/PartitionDateTimePattern.d.ts +0 -13
  370. package/lib/src/DateTimeFormat/PartitionDateTimePattern.d.ts.map +0 -1
  371. package/lib/src/DateTimeFormat/ToDateTimeOptions.d.ts.map +0 -1
  372. package/lib/src/DateTimeFormat/ToLocalTime.d.ts.map +0 -1
  373. package/lib/src/DateTimeFormat/skeleton.d.ts +0 -9
  374. package/lib/src/DateTimeFormat/skeleton.d.ts.map +0 -1
  375. package/lib/src/DateTimeFormat/utils.d.ts.map +0 -1
  376. package/lib/src/DefaultNumberOption.d.ts.map +0 -1
  377. package/lib/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +0 -1
  378. package/lib/src/GetNumberOption.d.ts.map +0 -1
  379. package/lib/src/GetOption.d.ts.map +0 -1
  380. package/lib/src/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
  381. package/lib/src/IsValidTimeZoneName.d.ts.map +0 -1
  382. package/lib/src/IsWellFormedCurrencyCode.d.ts.map +0 -1
  383. package/lib/src/IsWellFormedUnitIdentifier.d.ts.map +0 -1
  384. package/lib/src/LookupMatcher.d.ts.map +0 -1
  385. package/lib/src/LookupSupportedLocales.d.ts.map +0 -1
  386. package/lib/src/NumberFormat/ComputeExponent.d.ts.map +0 -1
  387. package/lib/src/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
  388. package/lib/src/NumberFormat/CurrencyDigits.d.ts.map +0 -1
  389. package/lib/src/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
  390. package/lib/src/NumberFormat/FormatNumericToString.d.ts.map +0 -1
  391. package/lib/src/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
  392. package/lib/src/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
  393. package/lib/src/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
  394. package/lib/src/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
  395. package/lib/src/NumberFormat/ToRawFixed.d.ts.map +0 -1
  396. package/lib/src/NumberFormat/ToRawPrecision.d.ts.map +0 -1
  397. package/lib/src/NumberFormat/format_to_parts.d.ts.map +0 -1
  398. package/lib/src/PartitionPattern.d.ts +0 -12
  399. package/lib/src/PartitionPattern.d.ts.map +0 -1
  400. package/lib/src/PluralRules/GetOperands.d.ts.map +0 -1
  401. package/lib/src/PluralRules/InitializePluralRules.d.ts.map +0 -1
  402. package/lib/src/PluralRules/ResolvePlural.d.ts.map +0 -1
  403. package/lib/src/RelativeTimeFormat/FormatRelativeTime.d.ts.map +0 -1
  404. package/lib/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +0 -1
  405. package/lib/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +0 -1
  406. package/lib/src/RelativeTimeFormat/MakePartsList.d.ts.map +0 -1
  407. package/lib/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +0 -1
  408. package/lib/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +0 -1
  409. package/lib/src/ResolveLocale.d.ts.map +0 -1
  410. package/lib/src/SupportedLocales.d.ts.map +0 -1
  411. package/lib/src/UnicodeExtensionValue.d.ts.map +0 -1
  412. package/lib/src/data.d.ts.map +0 -1
  413. package/lib/src/utils.d.ts.map +0 -1
  414. package/src/BestAvailableLocale.d.ts.map +0 -1
  415. package/src/BestFitMatcher.d.ts.map +0 -1
  416. package/src/CanonicalizeLocaleList.d.ts.map +0 -1
  417. package/src/CanonicalizeTimeZoneName.d.ts.map +0 -1
  418. package/src/DateTimeFormat/BasicFormatMatcher.d.ts.map +0 -1
  419. package/src/DateTimeFormat/BestFitFormatMatcher.d.ts.map +0 -1
  420. package/src/DateTimeFormat/DateTimeStyleFormat.d.ts.map +0 -1
  421. package/src/DateTimeFormat/FormatDateTime.d.ts.map +0 -1
  422. package/src/DateTimeFormat/FormatDateTimeToParts.d.ts.map +0 -1
  423. package/src/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +0 -1
  424. package/src/DateTimeFormat/PartitionDateTimePattern.d.ts +0 -13
  425. package/src/DateTimeFormat/PartitionDateTimePattern.d.ts.map +0 -1
  426. package/src/DateTimeFormat/ToDateTimeOptions.d.ts.map +0 -1
  427. package/src/DateTimeFormat/ToLocalTime.d.ts.map +0 -1
  428. package/src/DateTimeFormat/skeleton.d.ts +0 -9
  429. package/src/DateTimeFormat/skeleton.d.ts.map +0 -1
  430. package/src/DateTimeFormat/utils.d.ts.map +0 -1
  431. package/src/DefaultNumberOption.d.ts.map +0 -1
  432. package/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +0 -1
  433. package/src/GetNumberOption.d.ts.map +0 -1
  434. package/src/GetOption.d.ts.map +0 -1
  435. package/src/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
  436. package/src/IsValidTimeZoneName.d.ts.map +0 -1
  437. package/src/IsWellFormedCurrencyCode.d.ts.map +0 -1
  438. package/src/IsWellFormedUnitIdentifier.d.ts.map +0 -1
  439. package/src/LookupMatcher.d.ts.map +0 -1
  440. package/src/LookupSupportedLocales.d.ts.map +0 -1
  441. package/src/NumberFormat/ComputeExponent.d.ts.map +0 -1
  442. package/src/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
  443. package/src/NumberFormat/CurrencyDigits.d.ts.map +0 -1
  444. package/src/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
  445. package/src/NumberFormat/FormatNumericToString.d.ts.map +0 -1
  446. package/src/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
  447. package/src/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
  448. package/src/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
  449. package/src/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
  450. package/src/NumberFormat/ToRawFixed.d.ts.map +0 -1
  451. package/src/NumberFormat/ToRawPrecision.d.ts.map +0 -1
  452. package/src/NumberFormat/format_to_parts.d.ts.map +0 -1
  453. package/src/PartitionPattern.d.ts +0 -12
  454. package/src/PartitionPattern.d.ts.map +0 -1
  455. package/src/PluralRules/GetOperands.d.ts.map +0 -1
  456. package/src/PluralRules/InitializePluralRules.d.ts.map +0 -1
  457. package/src/PluralRules/ResolvePlural.d.ts.map +0 -1
  458. package/src/RelativeTimeFormat/FormatRelativeTime.d.ts.map +0 -1
  459. package/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +0 -1
  460. package/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +0 -1
  461. package/src/RelativeTimeFormat/MakePartsList.d.ts.map +0 -1
  462. package/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +0 -1
  463. package/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +0 -1
  464. package/src/ResolveLocale.d.ts.map +0 -1
  465. package/src/SupportedLocales.d.ts.map +0 -1
  466. package/src/UnicodeExtensionValue.d.ts.map +0 -1
  467. package/src/data.d.ts.map +0 -1
  468. package/src/utils.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BestAvailableLocale.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/BestAvailableLocale.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EAAE,EAC1B,MAAM,EAAE,MAAM,sBAgBf"}
@@ -1,4 +1,4 @@
1
- import { LookupMatcherResult } from '../types/core';
1
+ import { LookupMatcherResult } from './types/core';
2
2
  /**
3
3
  * https://tc39.es/ecma402/#sec-bestfitmatcher
4
4
  * @param availableLocales
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BestFitMatcher.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/BestFitMatcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAGjD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,MAAM,EAAE,EAC1B,gBAAgB,EAAE,MAAM,EAAE,EAC1B,gBAAgB,EAAE,MAAM,MAAM,GAC7B,mBAAmB,CAwBrB"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanonicalizeLocaleList.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/CanonicalizeLocaleList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,OAGjE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanonicalizeTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/CanonicalizeTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,UAgBF"}
@@ -1,4 +1,4 @@
1
- import { DateTimeFormatOptions, Formats } from '../../types/date-time';
1
+ import { DateTimeFormatOptions, Formats } from '../types/date-time';
2
2
  /**
3
3
  * https://tc39.es/ecma402/#sec-basicformatmatcher
4
4
  * @param options
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/BasicFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAYlE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,OAAO,EAAE,GACjB,OAAO,CAsCT"}
@@ -1,4 +1,4 @@
1
- import { DateTimeFormatOptions, Formats } from '../../types/date-time';
1
+ import { DateTimeFormatOptions, Formats } from '../types/date-time';
2
2
  /**
3
3
  * Credit: https://github.com/andyearnshaw/Intl.js/blob/0958dc1ad8153f1056653ea22b8208f0df289a4e/src/12.datetimeformat.js#L611
4
4
  * with some modifications
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BestFitFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/BestFitFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,OAAO,EAAU,MAAM,oBAAoB,CAAC;AAoB3E;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,OAAO,GACd,MAAM,CA0CR;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,OAAO,EAAE,WAsDnB"}
@@ -81,10 +81,11 @@ function BestFitFormatMatcher(options, formats) {
81
81
  }
82
82
  }
83
83
  var skeletonFormat = tslib_1.__assign({}, bestFormat);
84
- var patternFormat = skeleton_1.parseDateTimeSkeleton(bestFormat.rawPattern);
84
+ var patternFormat = { rawPattern: bestFormat.rawPattern };
85
+ skeleton_1.processDateTimePattern(bestFormat.rawPattern, patternFormat);
85
86
  // Kinda following https://github.com/unicode-org/icu/blob/dd50e38f459d84e9bf1b0c618be8483d318458ad/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java
86
87
  // Method adjustFieldTypes
87
- for (var prop in patternFormat) {
88
+ for (var prop in skeletonFormat) {
88
89
  var skeletonValue = skeletonFormat[prop];
89
90
  var patternValue = patternFormat[prop];
90
91
  var requestedValue = options[prop];
@@ -109,6 +110,12 @@ function BestFitFormatMatcher(options, formats) {
109
110
  }
110
111
  patternFormat[prop] = requestedValue;
111
112
  }
113
+ // Copy those over
114
+ patternFormat.pattern = skeletonFormat.pattern;
115
+ patternFormat.pattern12 = skeletonFormat.pattern12;
116
+ patternFormat.skeleton = skeletonFormat.skeleton;
117
+ patternFormat.rangePatterns = skeletonFormat.rangePatterns;
118
+ patternFormat.rangePatterns12 = skeletonFormat.rangePatterns12;
112
119
  return patternFormat;
113
120
  }
114
121
  exports.BestFitFormatMatcher = BestFitFormatMatcher;
@@ -1,3 +1,3 @@
1
- import { DateTimeFormatOptions, DateTimeFormatLocaleInternalData, Formats } from '../../types/date-time';
1
+ import { DateTimeFormatOptions, DateTimeFormatLocaleInternalData, Formats } from '../types/date-time';
2
2
  export declare function DateTimeStyleFormat(dateStyle: DateTimeFormatOptions['dateStyle'], timeStyle: DateTimeFormatOptions['timeStyle'], dataLocaleData: DateTimeFormatLocaleInternalData): Formats;
3
3
  //# sourceMappingURL=DateTimeStyleFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimeStyleFormat.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/DateTimeStyleFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gCAAgC,EAChC,OAAO,EACR,MAAM,oBAAoB,CAAC;AAG5B,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAAC,EAC7C,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAAC,EAC7C,cAAc,EAAE,gCAAgC,GAC/C,OAAO,CAuDT"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatDateTime.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,UAQ5D"}
@@ -0,0 +1,14 @@
1
+ import { IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData, IntlDateTimeFormatPart } from '../types/date-time';
2
+ import { ToLocalTimeImplDetails } from './ToLocalTime';
3
+ export interface FormatDateTimePatternImplDetails {
4
+ getInternalSlots(dtf: Intl.DateTimeFormat): IntlDateTimeFormatInternal;
5
+ localeData: Record<string, DateTimeFormatLocaleInternalData>;
6
+ getDefaultTimeZone(): string;
7
+ }
8
+ /**
9
+ * https://tc39.es/ecma402/#sec-partitiondatetimepattern
10
+ * @param dtf
11
+ * @param x
12
+ */
13
+ export declare function FormatDateTimePattern(dtf: Intl.DateTimeFormat, patternParts: IntlDateTimeFormatPart[], x: number, { getInternalSlots, localeData, getDefaultTimeZone, tzData, }: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): IntlDateTimeFormatPart[];
14
+ //# sourceMappingURL=FormatDateTimePattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatDateTimePattern.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimePattern.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAc,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAyClE,MAAM,WAAW,gCAAgC;IAC/C,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,0BAA0B,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;IAC7D,kBAAkB,IAAI,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,YAAY,EAAE,sBAAsB,EAAE,EACtC,CAAC,EAAE,MAAM,EACT,EACE,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,MAAM,GACP,EAAE,gCAAgC,GAAG,sBAAsB,GAC3D,sBAAsB,EAAE,CAiI1B"}
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PartitionDateTimePattern = void 0;
4
- var _262_1 = require("../../262");
5
- var PartitionPattern_1 = require("../PartitionPattern");
3
+ exports.FormatDateTimePattern = void 0;
6
4
  var utils_1 = require("./utils");
7
5
  var ToLocalTime_1 = require("./ToLocalTime");
6
+ var _262_1 = require("../262");
8
7
  function pad(n) {
9
8
  if (n < 10) {
10
9
  return "0" + n;
@@ -40,12 +39,9 @@ function offsetToGmtString(gmtFormat, hourFormat, offsetInMs, style) {
40
39
  * @param dtf
41
40
  * @param x
42
41
  */
43
- function PartitionDateTimePattern(dtf, x, _a) {
42
+ function FormatDateTimePattern(dtf, patternParts, x, _a) {
44
43
  var getInternalSlots = _a.getInternalSlots, localeData = _a.localeData, getDefaultTimeZone = _a.getDefaultTimeZone, tzData = _a.tzData;
45
44
  x = _262_1.TimeClip(x);
46
- if (isNaN(x)) {
47
- throw new RangeError('invalid time');
48
- }
49
45
  /** IMPL START */
50
46
  var internalSlots = getInternalSlots(dtf);
51
47
  var dataLocale = internalSlots.dataLocale;
@@ -63,7 +59,6 @@ function PartitionDateTimePattern(dtf, x, _a) {
63
59
  // @ts-ignore
64
60
  internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
65
61
  var result = [];
66
- var patternParts = PartitionPattern_1.PartitionPattern(internalSlots.pattern);
67
62
  for (var _i = 0, patternParts_1 = patternParts; _i < patternParts_1.length; _i++) {
68
63
  var patternPart = patternParts_1[_i];
69
64
  var p = patternPart.type;
@@ -167,14 +162,7 @@ function PartitionDateTimePattern(dtf, x, _a) {
167
162
  value: fv,
168
163
  });
169
164
  }
170
- else {
171
- result.push({
172
- // @ts-ignore TODO: Fix TS type
173
- type: 'unknown',
174
- value: String(x),
175
- });
176
- }
177
165
  }
178
166
  return result;
179
167
  }
180
- exports.PartitionDateTimePattern = PartitionDateTimePattern;
168
+ exports.FormatDateTimePattern = FormatDateTimePattern;
@@ -0,0 +1,4 @@
1
+ import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
2
+ import { ToLocalTimeImplDetails } from './ToLocalTime';
3
+ export declare function FormatDateTimeRange(dtf: Intl.DateTimeFormat, x: number, y: number, implDetails: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): string;
4
+ //# sourceMappingURL=FormatDateTimeRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatDateTimeRange.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimeRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gCAAgC,EAAC,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAErD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,gCAAgC,GAAG,sBAAsB,UAQvE"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormatDateTimeRange = void 0;
4
+ var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
5
+ function FormatDateTimeRange(dtf, x, y, implDetails) {
6
+ var parts = PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern(dtf, x, y, implDetails);
7
+ var result = '';
8
+ for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
9
+ var part = parts_1[_i];
10
+ result += part.value;
11
+ }
12
+ return result;
13
+ }
14
+ exports.FormatDateTimeRange = FormatDateTimeRange;
@@ -0,0 +1,4 @@
1
+ import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
2
+ import { ToLocalTimeImplDetails } from './ToLocalTime';
3
+ export declare function FormatDateTimeRangeToParts(dtf: Intl.DateTimeFormat, x: number, y: number, implDetails: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): any[];
4
+ //# sourceMappingURL=FormatDateTimeRangeToParts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatDateTimeRangeToParts.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimeRangeToParts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gCAAgC,EAAC,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAErD,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,gCAAgC,GAAG,sBAAsB,SAYvE"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormatDateTimeRangeToParts = void 0;
4
+ var PartitionDateTimeRangePattern_1 = require("./PartitionDateTimeRangePattern");
5
+ function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
6
+ var parts = PartitionDateTimeRangePattern_1.PartitionDateTimeRangePattern(dtf, x, y, implDetails);
7
+ var result = new Array(0);
8
+ for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
9
+ var part = parts_1[_i];
10
+ result.push({
11
+ type: part.type,
12
+ value: part.value,
13
+ source: part.source,
14
+ });
15
+ }
16
+ return result;
17
+ }
18
+ exports.FormatDateTimeRangeToParts = FormatDateTimeRangeToParts;
@@ -1,4 +1,5 @@
1
1
  import { PartitionDateTimePattern } from './PartitionDateTimePattern';
2
+ import { IntlDateTimeFormatPart } from '../types/date-time';
2
3
  /**
3
4
  * https://tc39.es/ecma402/#sec-formatdatetimetoparts
4
5
  *
@@ -6,5 +7,5 @@ import { PartitionDateTimePattern } from './PartitionDateTimePattern';
6
7
  * @param x
7
8
  * @param implDetails
8
9
  */
9
- export declare function FormatDateTimeToParts(dtf: Intl.DateTimeFormat, x: number, implDetails: Parameters<typeof PartitionDateTimePattern>[2]): Intl.DateTimeFormatPart[];
10
+ export declare function FormatDateTimeToParts(dtf: Intl.DateTimeFormat, x: number, implDetails: Parameters<typeof PartitionDateTimePattern>[2]): IntlDateTimeFormatPart[];
10
11
  //# sourceMappingURL=FormatDateTimeToParts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatDateTimeToParts.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/FormatDateTimeToParts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,GAC1D,sBAAsB,EAAE,CAU1B"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormatDateTimeToParts = void 0;
4
4
  var PartitionDateTimePattern_1 = require("./PartitionDateTimePattern");
5
- var _262_1 = require("../../262");
5
+ var _262_1 = require("../262");
6
6
  /**
7
7
  * https://tc39.es/ecma402/#sec-formatdatetimetoparts
8
8
  *
@@ -1,4 +1,4 @@
1
- import { DateTimeFormatOptions, IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData } from '../../types/date-time';
1
+ import { DateTimeFormatOptions, IntlDateTimeFormatInternal, DateTimeFormatLocaleInternalData } from '../types/date-time';
2
2
  /**
3
3
  * https://tc39.es/ecma402/#sec-initializedatetimeformat
4
4
  * @param dtf DateTimeFormat
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitializeDateTimeFormat.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/InitializeDateTimeFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,0BAA0B,EAC1B,gCAAgC,EACjC,MAAM,oBAAoB,CAAC;AAuD5B;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACtC,IAAI,EAAE,qBAAqB,GAAG,SAAS,EACvC,EACE,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,MAAM,EACN,cAAc,GACf,EAAE;IACD,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,0BAA0B,CAAC;IACvE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,IAAI,MAAM,CAAC;IAC3B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,GAAG,SAAS,CAAC,CAAC;IACzE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,GACA,IAAI,CAAC,cAAc,CA4OrB"}
@@ -22,6 +22,31 @@ function isTimeRelated(opt) {
22
22
  }
23
23
  return false;
24
24
  }
25
+ function resolveHourCycle(hc, hcDefault, hour12) {
26
+ if (hc == null) {
27
+ hc = hcDefault;
28
+ }
29
+ if (hour12 !== undefined) {
30
+ if (hour12) {
31
+ if (hcDefault === 'h11' || hcDefault === 'h23') {
32
+ hc = 'h11';
33
+ }
34
+ else {
35
+ hc = 'h12';
36
+ }
37
+ }
38
+ else {
39
+ utils_1.invariant(!hour12, 'hour12 must not be set');
40
+ if (hcDefault === 'h11' || hcDefault === 'h23') {
41
+ hc = 'h23';
42
+ }
43
+ else {
44
+ hc = 'h24';
45
+ }
46
+ }
47
+ }
48
+ return hc;
49
+ }
25
50
  var TYPE_REGEX = /^[a-z0-9]{3,8}$/i;
26
51
  /**
27
52
  * https://tc39.es/ecma402/#sec-initializedatetimeformat
@@ -103,11 +128,12 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
103
128
  bestFormat = BasicFormatMatcher_1.BasicFormatMatcher(opt, formats);
104
129
  }
105
130
  else {
131
+ // IMPL DETAILS START
106
132
  if (isTimeRelated(opt)) {
107
- opt.hour12 =
108
- internalSlots.hourCycle === 'h11' ||
109
- internalSlots.hourCycle === 'h12';
133
+ var hc = resolveHourCycle(internalSlots.hourCycle, dataLocaleData.hourCycle, hour12);
134
+ opt.hour12 = hc === 'h11' || hc === 'h12';
110
135
  }
136
+ // IMPL DETAILS END
111
137
  bestFormat = BestFitFormatMatcher_1.BestFitFormatMatcher(opt, formats);
112
138
  }
113
139
  }
@@ -121,6 +147,10 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
121
147
  }
122
148
  bestFormat = DateTimeStyleFormat_1.DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData);
123
149
  }
150
+ // IMPL DETAIL START
151
+ // For debugging
152
+ internalSlots.format = bestFormat;
153
+ // IMPL DETAIL END
124
154
  for (var prop in opt) {
125
155
  var p = bestFormat[prop];
126
156
  if (p !== undefined) {
@@ -128,45 +158,27 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
128
158
  }
129
159
  }
130
160
  var pattern;
161
+ var rangePatterns;
131
162
  if (internalSlots.hour !== undefined) {
132
- var hcDefault = dataLocaleData.hourCycle;
133
- var hc = internalSlots.hourCycle;
134
- if (hc == null) {
135
- hc = hcDefault;
136
- }
137
- if (hour12 !== undefined) {
138
- if (hour12) {
139
- if (hcDefault === 'h11' || hcDefault === 'h23') {
140
- hc = 'h11';
141
- }
142
- else {
143
- hc = 'h12';
144
- }
145
- }
146
- else {
147
- utils_1.invariant(!hour12, 'hour12 must not be set');
148
- if (hcDefault === 'h11' || hcDefault === 'h23') {
149
- hc = 'h23';
150
- }
151
- else {
152
- hc = 'h24';
153
- }
154
- }
155
- }
163
+ var hc = resolveHourCycle(internalSlots.hourCycle, dataLocaleData.hourCycle, hour12);
156
164
  internalSlots.hourCycle = hc;
157
165
  if (hc === 'h11' || hc === 'h12') {
158
166
  pattern = bestFormat.pattern12;
167
+ rangePatterns = bestFormat.rangePatterns12;
159
168
  }
160
169
  else {
161
170
  pattern = bestFormat.pattern;
171
+ rangePatterns = bestFormat.rangePatterns;
162
172
  }
163
173
  }
164
174
  else {
165
175
  // @ts-ignore
166
176
  internalSlots.hourCycle = undefined;
167
177
  pattern = bestFormat.pattern;
178
+ rangePatterns = bestFormat.rangePatterns;
168
179
  }
169
180
  internalSlots.pattern = pattern;
181
+ internalSlots.rangePatterns = rangePatterns;
170
182
  return dtf;
171
183
  }
172
184
  exports.InitializeDateTimeFormat = InitializeDateTimeFormat;
@@ -0,0 +1,10 @@
1
+ import { ToLocalTimeImplDetails } from './ToLocalTime';
2
+ import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
3
+ import { IntlDateTimeFormatPart } from '../types/date-time';
4
+ /**
5
+ * https://tc39.es/ecma402/#sec-partitiondatetimepattern
6
+ * @param dtf
7
+ * @param x
8
+ */
9
+ export declare function PartitionDateTimePattern(dtf: Intl.DateTimeFormat, x: number, implDetails: ToLocalTimeImplDetails & FormatDateTimePatternImplDetails): IntlDateTimeFormatPart[];
10
+ //# sourceMappingURL=PartitionDateTimePattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PartitionDateTimePattern.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/PartitionDateTimePattern.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAEL,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,sBAAsB,GAAG,gCAAgC,GACrE,sBAAsB,EAAE,CAkB1B"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartitionDateTimePattern = void 0;
4
+ var _262_1 = require("../262");
5
+ var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
6
+ var PartitionPattern_1 = require("../PartitionPattern");
7
+ /**
8
+ * https://tc39.es/ecma402/#sec-partitiondatetimepattern
9
+ * @param dtf
10
+ * @param x
11
+ */
12
+ function PartitionDateTimePattern(dtf, x, implDetails) {
13
+ x = _262_1.TimeClip(x);
14
+ if (isNaN(x)) {
15
+ throw new RangeError('invalid time');
16
+ }
17
+ /** IMPL START */
18
+ var getInternalSlots = implDetails.getInternalSlots;
19
+ var internalSlots = getInternalSlots(dtf);
20
+ /** IMPL END */
21
+ var pattern = internalSlots.pattern;
22
+ return FormatDateTimePattern_1.FormatDateTimePattern(dtf, PartitionPattern_1.PartitionPattern(pattern), x, implDetails);
23
+ }
24
+ exports.PartitionDateTimePattern = PartitionDateTimePattern;
@@ -0,0 +1,5 @@
1
+ import { IntlDateTimeFormatPart } from '../types/date-time';
2
+ import { ToLocalTimeImplDetails } from './ToLocalTime';
3
+ import { FormatDateTimePatternImplDetails } from './FormatDateTimePattern';
4
+ export declare function PartitionDateTimeRangePattern(dtf: Intl.DateTimeFormat, x: number, y: number, implDetails: FormatDateTimePatternImplDetails & ToLocalTimeImplDetails): IntlDateTimeFormatPart[];
5
+ //# sourceMappingURL=PartitionDateTimeRangePattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PartitionDateTimeRangePattern.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/PartitionDateTimeRangePattern.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAIvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAc,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAClE,OAAO,EAEL,gCAAgC,EACjC,MAAM,yBAAyB,CAAC;AAcjC,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,gCAAgC,GAAG,sBAAsB,4BA+FvE"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartitionDateTimeRangePattern = void 0;
4
+ var _262_1 = require("../262");
5
+ var ToLocalTime_1 = require("./ToLocalTime");
6
+ var FormatDateTimePattern_1 = require("./FormatDateTimePattern");
7
+ var PartitionPattern_1 = require("../PartitionPattern");
8
+ var TABLE_2_FIELDS = [
9
+ 'era',
10
+ 'year',
11
+ 'month',
12
+ 'day',
13
+ 'ampm',
14
+ 'hour',
15
+ 'minute',
16
+ 'second',
17
+ ];
18
+ function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {
19
+ x = _262_1.TimeClip(x);
20
+ if (isNaN(x)) {
21
+ throw new RangeError('Invalid start time');
22
+ }
23
+ y = _262_1.TimeClip(y);
24
+ if (isNaN(y)) {
25
+ throw new RangeError('Invalid end time');
26
+ }
27
+ /** IMPL START */
28
+ var getInternalSlots = implDetails.getInternalSlots, tzData = implDetails.tzData;
29
+ var internalSlots = getInternalSlots(dtf);
30
+ /** IMPL END */
31
+ var tm1 = ToLocalTime_1.ToLocalTime(x,
32
+ // @ts-ignore
33
+ internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
34
+ var tm2 = ToLocalTime_1.ToLocalTime(y,
35
+ // @ts-ignore
36
+ internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
37
+ var pattern = internalSlots.pattern, rangePatterns = internalSlots.rangePatterns;
38
+ var rangePattern;
39
+ var dateFieldsPracticallyEqual = true;
40
+ var patternContainsLargerDateField = false;
41
+ for (var _i = 0, TABLE_2_FIELDS_1 = TABLE_2_FIELDS; _i < TABLE_2_FIELDS_1.length; _i++) {
42
+ var fieldName = TABLE_2_FIELDS_1[_i];
43
+ if (dateFieldsPracticallyEqual && !patternContainsLargerDateField) {
44
+ if (fieldName === 'ampm') {
45
+ var v1 = tm1.hour;
46
+ var v2 = tm2.hour;
47
+ var rp = rangePatterns.ampm;
48
+ if ((v1 > 11 && v2 < 11) || (v1 < 11 && v2 > 11)) {
49
+ dateFieldsPracticallyEqual = false;
50
+ }
51
+ if (rangePattern !== undefined && rp === undefined) {
52
+ patternContainsLargerDateField = true;
53
+ }
54
+ rangePattern = rp;
55
+ }
56
+ else {
57
+ var v1 = tm1[fieldName];
58
+ var v2 = tm2[fieldName];
59
+ var rp = rangePatterns[fieldName];
60
+ if (!_262_1.SameValue(v1, v2)) {
61
+ dateFieldsPracticallyEqual = false;
62
+ }
63
+ if (rangePattern !== undefined && rp === undefined) {
64
+ patternContainsLargerDateField = true;
65
+ }
66
+ rangePattern = rp;
67
+ }
68
+ }
69
+ }
70
+ if (dateFieldsPracticallyEqual) {
71
+ var result_2 = FormatDateTimePattern_1.FormatDateTimePattern(dtf, PartitionPattern_1.PartitionPattern(pattern), x, implDetails);
72
+ for (var _a = 0, result_1 = result_2; _a < result_1.length; _a++) {
73
+ var r = result_1[_a];
74
+ r.source = "shared" /* shared */;
75
+ }
76
+ return result_2;
77
+ }
78
+ var result = [];
79
+ if (rangePattern === undefined) {
80
+ rangePattern = rangePatterns.default;
81
+ }
82
+ for (var _b = 0, _c = rangePattern.patternParts; _b < _c.length; _b++) {
83
+ var rangePatternPart = _c[_b];
84
+ var source = rangePatternPart.source, pattern_1 = rangePatternPart.pattern;
85
+ var z = void 0;
86
+ if (source === "startRange" /* startRange */ ||
87
+ source === "shared" /* shared */) {
88
+ z = x;
89
+ }
90
+ else {
91
+ z = y;
92
+ }
93
+ var patternParts = PartitionPattern_1.PartitionPattern(pattern_1);
94
+ var partResult = FormatDateTimePattern_1.FormatDateTimePattern(dtf, patternParts, z, implDetails);
95
+ for (var _d = 0, partResult_1 = partResult; _d < partResult_1.length; _d++) {
96
+ var r = partResult_1[_d];
97
+ r.source = source;
98
+ }
99
+ result = result.concat(partResult);
100
+ }
101
+ return result;
102
+ }
103
+ exports.PartitionDateTimeRangePattern = PartitionDateTimeRangePattern;
@@ -1,4 +1,4 @@
1
- import { DateTimeFormatOptions } from '../../types/date-time';
1
+ import { DateTimeFormatOptions } from '../types/date-time';
2
2
  /**
3
3
  * https://tc39.es/ecma402/#sec-todatetimeoptions
4
4
  * @param options
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToDateTimeOptions.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/ToDateTimeOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,EACtC,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,qBAAqB,CAyDvB"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ToDateTimeOptions = void 0;
4
- var _262_1 = require("../../262");
4
+ var _262_1 = require("../262");
5
5
  /**
6
6
  * https://tc39.es/ecma402/#sec-todatetimeoptions
7
7
  * @param options
@@ -1,13 +1,14 @@
1
- import { UnpackedZoneData } from '../../types/date-time';
1
+ import { UnpackedZoneData } from '../types/date-time';
2
+ export interface ToLocalTimeImplDetails {
3
+ tzData: Record<string, UnpackedZoneData[]>;
4
+ }
2
5
  /**
3
6
  * https://tc39.es/ecma402/#sec-tolocaltime
4
7
  * @param t
5
8
  * @param calendar
6
9
  * @param timeZone
7
10
  */
8
- export declare function ToLocalTime(t: number, calendar: string, timeZone: string, { tzData }: {
9
- tzData: Record<string, UnpackedZoneData[]>;
10
- }): {
11
+ export declare function ToLocalTime(t: number, calendar: string, timeZone: string, { tzData }: ToLocalTimeImplDetails): {
11
12
  weekday: number;
12
13
  era: string;
13
14
  year: number;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToLocalTime.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/ToLocalTime.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAkCpD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;CAC5C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,EAAC,MAAM,EAAC,EAAE,sBAAsB,GAC/B;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,SAAS,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB,CAyBA"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ToLocalTime = void 0;
4
4
  var utils_1 = require("../utils");
5
- var _262_1 = require("../../262");
5
+ var _262_1 = require("../262");
6
6
  function getApplicableZoneData(t, timeZone, tzData) {
7
7
  var _a;
8
8
  var zoneData = tzData[timeZone];
@@ -0,0 +1,14 @@
1
+ import { DateTimeFormatOptions, Formats, RangePatternPart } from '../types/date-time';
2
+ export declare function processDateTimePattern(pattern: string, result?: Pick<DateTimeFormatOptions, 'weekday' | 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'timeZoneName'> & {
3
+ hour12?: boolean;
4
+ }): [string, string];
5
+ /**
6
+ * Parse Date time skeleton into Intl.DateTimeFormatOptions
7
+ * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
8
+ * @public
9
+ * @param skeleton skeleton string
10
+ */
11
+ export declare function parseDateTimeSkeleton(skeleton: string, rawPattern?: string, rangePatterns?: Record<string, string>, intervalFormatFallback?: string): Formats;
12
+ export declare function splitFallbackRangePattern(pattern: string): Array<RangePatternPart>;
13
+ export declare function splitRangePattern(pattern: string): Array<RangePatternPart>;
14
+ //# sourceMappingURL=skeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/DateTimeFormat/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,gBAAgB,EAIjB,MAAM,oBAAoB,CAAC;AA+M5B,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,IAAI,CACX,qBAAqB,EACnB,SAAS,GACT,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,cAAc,CACjB,GAAG;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,CAAC,MAAM,EAAE,MAAM,CAAC,CA8BlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAiB,EAC7B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,sBAAsB,CAAC,EAAE,MAAM,GAC9B,OAAO,CA+CT;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,GACd,KAAK,CAAC,gBAAgB,CAAC,CAqBzB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAgC1E"}