@nubjs/nub-darwin-x64 0.2.3 → 0.2.5

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 (348) hide show
  1. package/bin/nub +0 -0
  2. package/bin/nubx +0 -0
  3. package/package.json +2 -3
  4. package/runtime/addons/nub-native.node +0 -0
  5. package/runtime/cache-evict.mjs +0 -69
  6. package/runtime/compile-cache-restore.mjs +0 -21
  7. package/runtime/floor-builtin.mjs +0 -57
  8. package/runtime/navigator-locks.mjs +0 -242
  9. package/runtime/navigator-shim.mjs +0 -144
  10. package/runtime/node_modules/@js-temporal/polyfill/CHANGELOG.md +0 -453
  11. package/runtime/node_modules/@js-temporal/polyfill/LICENSE +0 -13
  12. package/runtime/node_modules/@js-temporal/polyfill/README.md +0 -90
  13. package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs +0 -2
  14. package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs.map +0 -1
  15. package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js +0 -2
  16. package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js.map +0 -1
  17. package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js +0 -2
  18. package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js.map +0 -1
  19. package/runtime/node_modules/@js-temporal/polyfill/index.d.cts +0 -1215
  20. package/runtime/node_modules/@js-temporal/polyfill/index.d.ts +0 -1215
  21. package/runtime/node_modules/@js-temporal/polyfill/lib/assert.ts +0 -8
  22. package/runtime/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +0 -39
  23. package/runtime/node_modules/@js-temporal/polyfill/lib/calendar.ts +0 -2424
  24. package/runtime/node_modules/@js-temporal/polyfill/lib/debug.ts +0 -7
  25. package/runtime/node_modules/@js-temporal/polyfill/lib/duration.ts +0 -438
  26. package/runtime/node_modules/@js-temporal/polyfill/lib/durationformat.d.ts +0 -93
  27. package/runtime/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +0 -4973
  28. package/runtime/node_modules/@js-temporal/polyfill/lib/index.ts +0 -34
  29. package/runtime/node_modules/@js-temporal/polyfill/lib/init.ts +0 -43
  30. package/runtime/node_modules/@js-temporal/polyfill/lib/instant.ts +0 -138
  31. package/runtime/node_modules/@js-temporal/polyfill/lib/internaltypes.d.ts +0 -242
  32. package/runtime/node_modules/@js-temporal/polyfill/lib/intl.ts +0 -758
  33. package/runtime/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +0 -162
  34. package/runtime/node_modules/@js-temporal/polyfill/lib/legacydate.ts +0 -17
  35. package/runtime/node_modules/@js-temporal/polyfill/lib/math.ts +0 -96
  36. package/runtime/node_modules/@js-temporal/polyfill/lib/now.ts +0 -48
  37. package/runtime/node_modules/@js-temporal/polyfill/lib/plaindate.ts +0 -212
  38. package/runtime/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +0 -274
  39. package/runtime/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +0 -110
  40. package/runtime/node_modules/@js-temporal/polyfill/lib/plaintime.ts +0 -154
  41. package/runtime/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +0 -157
  42. package/runtime/node_modules/@js-temporal/polyfill/lib/regex.ts +0 -59
  43. package/runtime/node_modules/@js-temporal/polyfill/lib/slots.ts +0 -341
  44. package/runtime/node_modules/@js-temporal/polyfill/lib/temporal.ts +0 -10
  45. package/runtime/node_modules/@js-temporal/polyfill/lib/timeduration.ts +0 -149
  46. package/runtime/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +0 -492
  47. package/runtime/node_modules/@js-temporal/polyfill/package.json +0 -143
  48. package/runtime/node_modules/@oxc-project/runtime/CHANGELOG.md +0 -88
  49. package/runtime/node_modules/@oxc-project/runtime/LICENSE +0 -22
  50. package/runtime/node_modules/@oxc-project/runtime/README.md +0 -5
  51. package/runtime/node_modules/@oxc-project/runtime/package.json +0 -1066
  52. package/runtime/node_modules/@oxc-project/runtime/src/helpers/AwaitValue.js +0 -4
  53. package/runtime/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js +0 -4
  54. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecoratedDescriptor.js +0 -9
  55. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs.js +0 -236
  56. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203.js +0 -184
  57. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203R.js +0 -191
  58. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2301.js +0 -222
  59. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2305.js +0 -133
  60. package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2311.js +0 -124
  61. package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayLikeToArray.js +0 -6
  62. package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithHoles.js +0 -4
  63. package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithoutHoles.js +0 -5
  64. package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertClassBrand.js +0 -5
  65. package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertThisInitialized.js +0 -5
  66. package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js +0 -24
  67. package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js +0 -45
  68. package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js +0 -26
  69. package/runtime/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js +0 -5
  70. package/runtime/node_modules/@oxc-project/runtime/src/helpers/callSuper.js +0 -7
  71. package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkInRHS.js +0 -6
  72. package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkPrivateRedeclaration.js +0 -4
  73. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorDestructureSet.js +0 -10
  74. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorGet.js +0 -4
  75. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorSet.js +0 -7
  76. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCallCheck.js +0 -4
  77. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticAccess.js +0 -5
  78. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticFieldDescriptor.js +0 -4
  79. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classExtractFieldDescriptor.js +0 -5
  80. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classNameTDZError.js +0 -4
  81. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldDestructureSet.js +0 -7
  82. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet.js +0 -7
  83. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet2.js +0 -5
  84. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldInitSpec.js +0 -5
  85. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseBase.js +0 -5
  86. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseKey.js +0 -5
  87. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet.js +0 -7
  88. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet2.js +0 -5
  89. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateGetter.js +0 -5
  90. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodGet.js +0 -5
  91. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodInitSpec.js +0 -5
  92. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodSet.js +0 -4
  93. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateSetter.js +0 -5
  94. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldDestructureSet.js +0 -7
  95. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecGet.js +0 -7
  96. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecSet.js +0 -7
  97. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodGet.js +0 -5
  98. package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodSet.js +0 -4
  99. package/runtime/node_modules/@oxc-project/runtime/src/helpers/construct.js +0 -10
  100. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createClass.js +0 -13
  101. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelper.js +0 -50
  102. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelperLoose.js +0 -19
  103. package/runtime/node_modules/@oxc-project/runtime/src/helpers/createSuper.js +0 -16
  104. package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorate.js +0 -23
  105. package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateMetadata.js +0 -9
  106. package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateParam.js +0 -11
  107. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defaults.js +0 -9
  108. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineAccessor.js +0 -8
  109. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineEnumerableProperties.js +0 -12
  110. package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js +0 -10
  111. package/runtime/node_modules/@oxc-project/runtime/src/helpers/dispose.js +0 -28
  112. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/AwaitValue.js +0 -4
  113. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/OverloadYield.js +0 -4
  114. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecoratedDescriptor.js +0 -9
  115. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs.js +0 -236
  116. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203.js +0 -184
  117. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203R.js +0 -191
  118. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2301.js +0 -222
  119. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2305.js +0 -133
  120. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2311.js +0 -124
  121. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayLikeToArray.js +0 -6
  122. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithHoles.js +0 -4
  123. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithoutHoles.js +0 -5
  124. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertClassBrand.js +0 -5
  125. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertThisInitialized.js +0 -5
  126. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncGeneratorDelegate.js +0 -24
  127. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncIterator.js +0 -45
  128. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncToGenerator.js +0 -26
  129. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/awaitAsyncGenerator.js +0 -5
  130. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/callSuper.js +0 -7
  131. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkInRHS.js +0 -6
  132. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkPrivateRedeclaration.js +0 -4
  133. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorDestructureSet.js +0 -10
  134. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorGet.js +0 -4
  135. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorSet.js +0 -7
  136. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCallCheck.js +0 -4
  137. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticAccess.js +0 -5
  138. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +0 -4
  139. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classExtractFieldDescriptor.js +0 -5
  140. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classNameTDZError.js +0 -4
  141. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldDestructureSet.js +0 -7
  142. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet.js +0 -7
  143. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet2.js +0 -5
  144. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldInitSpec.js +0 -5
  145. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseBase.js +0 -5
  146. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseKey.js +0 -5
  147. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet.js +0 -7
  148. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet2.js +0 -5
  149. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateGetter.js +0 -5
  150. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodGet.js +0 -5
  151. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodInitSpec.js +0 -5
  152. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodSet.js +0 -4
  153. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateSetter.js +0 -5
  154. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldDestructureSet.js +0 -7
  155. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecGet.js +0 -7
  156. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecSet.js +0 -7
  157. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodGet.js +0 -5
  158. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodSet.js +0 -4
  159. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/construct.js +0 -10
  160. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createClass.js +0 -13
  161. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelper.js +0 -50
  162. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelperLoose.js +0 -19
  163. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createSuper.js +0 -16
  164. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorate.js +0 -21
  165. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateMetadata.js +0 -7
  166. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateParam.js +0 -9
  167. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defaults.js +0 -9
  168. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineAccessor.js +0 -8
  169. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineEnumerableProperties.js +0 -12
  170. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js +0 -10
  171. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/dispose.js +0 -28
  172. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/extends.js +0 -10
  173. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/get.js +0 -11
  174. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/getPrototypeOf.js +0 -6
  175. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/identity.js +0 -4
  176. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/importDeferProxy.js +0 -27
  177. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inherits.js +0 -14
  178. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inheritsLoose.js +0 -5
  179. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerDefineProperty.js +0 -9
  180. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerWarningHelper.js +0 -4
  181. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/instanceof.js +0 -4
  182. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireDefault.js +0 -6
  183. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireWildcard.js +0 -27
  184. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeFunction.js +0 -8
  185. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeReflectConstruct.js +0 -9
  186. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArray.js +0 -4
  187. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArrayLimit.js +0 -28
  188. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/jsx.js +0 -22
  189. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/maybeArrayLike.js +0 -9
  190. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/newArrowCheck.js +0 -4
  191. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableRest.js +0 -4
  192. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableSpread.js +0 -4
  193. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nullishReceiverError.js +0 -4
  194. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectDestructuringEmpty.js +0 -4
  195. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread.js +0 -14
  196. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread2.js +0 -23
  197. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutProperties.js +0 -13
  198. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutPropertiesLoose.js +0 -10
  199. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/package.json +0 -3
  200. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/possibleConstructorReturn.js +0 -8
  201. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/readOnlyError.js +0 -4
  202. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/regeneratorRuntime.js +0 -304
  203. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/set.js +0 -22
  204. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setFunctionName.js +0 -12
  205. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setPrototypeOf.js +0 -6
  206. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/skipFirstGeneratorNext.js +0 -7
  207. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/slicedToArray.js +0 -8
  208. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropBase.js +0 -6
  209. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropGet.js +0 -9
  210. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropSet.js +0 -6
  211. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteral.js +0 -8
  212. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteralLoose.js +0 -4
  213. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/tdz.js +0 -4
  214. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalRef.js +0 -6
  215. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalUndefined.js +0 -2
  216. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toArray.js +0 -8
  217. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toConsumableArray.js +0 -8
  218. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js +0 -12
  219. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js +0 -7
  220. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toSetter.js +0 -10
  221. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js +0 -10
  222. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/unsupportedIterableToArray.js +0 -9
  223. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/using.js +0 -12
  224. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/usingCtx.js +0 -59
  225. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapAsyncGenerator.js +0 -69
  226. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapNativeSuper.js +0 -27
  227. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapRegExp.js +0 -51
  228. package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/writeOnlyError.js +0 -4
  229. package/runtime/node_modules/@oxc-project/runtime/src/helpers/extends.js +0 -10
  230. package/runtime/node_modules/@oxc-project/runtime/src/helpers/get.js +0 -11
  231. package/runtime/node_modules/@oxc-project/runtime/src/helpers/getPrototypeOf.js +0 -6
  232. package/runtime/node_modules/@oxc-project/runtime/src/helpers/identity.js +0 -4
  233. package/runtime/node_modules/@oxc-project/runtime/src/helpers/importDeferProxy.js +0 -27
  234. package/runtime/node_modules/@oxc-project/runtime/src/helpers/inherits.js +0 -14
  235. package/runtime/node_modules/@oxc-project/runtime/src/helpers/inheritsLoose.js +0 -5
  236. package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerDefineProperty.js +0 -9
  237. package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerWarningHelper.js +0 -4
  238. package/runtime/node_modules/@oxc-project/runtime/src/helpers/instanceof.js +0 -4
  239. package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireDefault.js +0 -6
  240. package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireWildcard.js +0 -27
  241. package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeFunction.js +0 -8
  242. package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeReflectConstruct.js +0 -9
  243. package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArray.js +0 -4
  244. package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArrayLimit.js +0 -28
  245. package/runtime/node_modules/@oxc-project/runtime/src/helpers/jsx.js +0 -22
  246. package/runtime/node_modules/@oxc-project/runtime/src/helpers/maybeArrayLike.js +0 -9
  247. package/runtime/node_modules/@oxc-project/runtime/src/helpers/newArrowCheck.js +0 -4
  248. package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableRest.js +0 -4
  249. package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableSpread.js +0 -4
  250. package/runtime/node_modules/@oxc-project/runtime/src/helpers/nullishReceiverError.js +0 -4
  251. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectDestructuringEmpty.js +0 -4
  252. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread.js +0 -14
  253. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js +0 -23
  254. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js +0 -13
  255. package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js +0 -10
  256. package/runtime/node_modules/@oxc-project/runtime/src/helpers/possibleConstructorReturn.js +0 -8
  257. package/runtime/node_modules/@oxc-project/runtime/src/helpers/readOnlyError.js +0 -4
  258. package/runtime/node_modules/@oxc-project/runtime/src/helpers/regeneratorRuntime.js +0 -304
  259. package/runtime/node_modules/@oxc-project/runtime/src/helpers/set.js +0 -22
  260. package/runtime/node_modules/@oxc-project/runtime/src/helpers/setFunctionName.js +0 -12
  261. package/runtime/node_modules/@oxc-project/runtime/src/helpers/setPrototypeOf.js +0 -6
  262. package/runtime/node_modules/@oxc-project/runtime/src/helpers/skipFirstGeneratorNext.js +0 -7
  263. package/runtime/node_modules/@oxc-project/runtime/src/helpers/slicedToArray.js +0 -8
  264. package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropBase.js +0 -6
  265. package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropGet.js +0 -9
  266. package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropSet.js +0 -6
  267. package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteral.js +0 -8
  268. package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteralLoose.js +0 -4
  269. package/runtime/node_modules/@oxc-project/runtime/src/helpers/tdz.js +0 -4
  270. package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalRef.js +0 -6
  271. package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalUndefined.js +0 -2
  272. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toArray.js +0 -8
  273. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toConsumableArray.js +0 -8
  274. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js +0 -12
  275. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js +0 -7
  276. package/runtime/node_modules/@oxc-project/runtime/src/helpers/toSetter.js +0 -10
  277. package/runtime/node_modules/@oxc-project/runtime/src/helpers/typeof.js +0 -10
  278. package/runtime/node_modules/@oxc-project/runtime/src/helpers/unsupportedIterableToArray.js +0 -9
  279. package/runtime/node_modules/@oxc-project/runtime/src/helpers/using.js +0 -12
  280. package/runtime/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js +0 -59
  281. package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js +0 -69
  282. package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapNativeSuper.js +0 -27
  283. package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapRegExp.js +0 -51
  284. package/runtime/node_modules/@oxc-project/runtime/src/helpers/writeOnlyError.js +0 -4
  285. package/runtime/node_modules/@petamoriken/float16/LICENSE +0 -21
  286. package/runtime/node_modules/@petamoriken/float16/README.md +0 -413
  287. package/runtime/node_modules/@petamoriken/float16/browser/float16.js +0 -1340
  288. package/runtime/node_modules/@petamoriken/float16/browser/float16.mjs +0 -1325
  289. package/runtime/node_modules/@petamoriken/float16/index.d.ts +0 -546
  290. package/runtime/node_modules/@petamoriken/float16/index.v5.6.d.ts +0 -546
  291. package/runtime/node_modules/@petamoriken/float16/index.v5.7.d.ts +0 -555
  292. package/runtime/node_modules/@petamoriken/float16/inspect/node.cjs +0 -25
  293. package/runtime/node_modules/@petamoriken/float16/inspect/node.mjs +0 -23
  294. package/runtime/node_modules/@petamoriken/float16/lib/DataView.cjs +0 -16
  295. package/runtime/node_modules/@petamoriken/float16/lib/Float16Array.cjs +0 -690
  296. package/runtime/node_modules/@petamoriken/float16/lib/_util/arrayIterator.cjs +0 -52
  297. package/runtime/node_modules/@petamoriken/float16/lib/_util/brand.cjs +0 -27
  298. package/runtime/node_modules/@petamoriken/float16/lib/_util/converter.cjs +0 -111
  299. package/runtime/node_modules/@petamoriken/float16/lib/_util/is.cjs +0 -78
  300. package/runtime/node_modules/@petamoriken/float16/lib/_util/messages.cjs +0 -18
  301. package/runtime/node_modules/@petamoriken/float16/lib/_util/primordials.cjs +0 -150
  302. package/runtime/node_modules/@petamoriken/float16/lib/_util/spec.cjs +0 -84
  303. package/runtime/node_modules/@petamoriken/float16/lib/f16round.cjs +0 -10
  304. package/runtime/node_modules/@petamoriken/float16/lib/index.cjs +0 -16
  305. package/runtime/node_modules/@petamoriken/float16/lib/isTypedArray.cjs +0 -11
  306. package/runtime/node_modules/@petamoriken/float16/package.json +0 -115
  307. package/runtime/node_modules/@petamoriken/float16/src/DataView.mjs +0 -35
  308. package/runtime/node_modules/@petamoriken/float16/src/Float16Array.mjs +0 -1194
  309. package/runtime/node_modules/@petamoriken/float16/src/_util/arrayIterator.mjs +0 -86
  310. package/runtime/node_modules/@petamoriken/float16/src/_util/brand.mjs +0 -31
  311. package/runtime/node_modules/@petamoriken/float16/src/_util/converter.mjs +0 -173
  312. package/runtime/node_modules/@petamoriken/float16/src/_util/is.mjs +0 -151
  313. package/runtime/node_modules/@petamoriken/float16/src/_util/messages.mjs +0 -22
  314. package/runtime/node_modules/@petamoriken/float16/src/_util/primordials.mjs +0 -254
  315. package/runtime/node_modules/@petamoriken/float16/src/_util/spec.mjs +0 -137
  316. package/runtime/node_modules/@petamoriken/float16/src/f16round.mjs +0 -10
  317. package/runtime/node_modules/@petamoriken/float16/src/index.mjs +0 -7
  318. package/runtime/node_modules/@petamoriken/float16/src/isTypedArray.mjs +0 -10
  319. package/runtime/node_modules/jsbi/LICENSE +0 -176
  320. package/runtime/node_modules/jsbi/README.md +0 -173
  321. package/runtime/node_modules/jsbi/dist/jsbi-cjs.js +0 -2
  322. package/runtime/node_modules/jsbi/dist/jsbi-cjs.js.map +0 -1
  323. package/runtime/node_modules/jsbi/dist/jsbi-umd.js +0 -2
  324. package/runtime/node_modules/jsbi/dist/jsbi-umd.js.map +0 -1
  325. package/runtime/node_modules/jsbi/dist/jsbi.mjs +0 -2
  326. package/runtime/node_modules/jsbi/dist/jsbi.mjs.map +0 -1
  327. package/runtime/node_modules/jsbi/jsbi.d.ts +0 -43
  328. package/runtime/node_modules/jsbi/package.json +0 -35
  329. package/runtime/node_modules/urlpattern-polyfill/LICENSE +0 -19
  330. package/runtime/node_modules/urlpattern-polyfill/README.md +0 -242
  331. package/runtime/node_modules/urlpattern-polyfill/dist/index.d.ts +0 -9
  332. package/runtime/node_modules/urlpattern-polyfill/dist/types.d.ts +0 -49
  333. package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +0 -1
  334. package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.js +0 -1
  335. package/runtime/node_modules/urlpattern-polyfill/index.cjs +0 -7
  336. package/runtime/node_modules/urlpattern-polyfill/index.js +0 -7
  337. package/runtime/node_modules/urlpattern-polyfill/package.json +0 -149
  338. package/runtime/pnp-bin-run.cjs +0 -91
  339. package/runtime/pnp-util.cjs +0 -62
  340. package/runtime/polyfills.cjs +0 -816
  341. package/runtime/preload-async-hooks.mjs +0 -110
  342. package/runtime/preload-common.cjs +0 -1096
  343. package/runtime/preload.cjs +0 -313
  344. package/runtime/preload.mjs +0 -149
  345. package/runtime/transform-core.mjs +0 -756
  346. package/runtime/version.mjs +0 -12
  347. package/runtime/worker-blob-url.cjs +0 -116
  348. package/runtime/worker-polyfill.mjs +0 -541
@@ -1,758 +0,0 @@
1
- import { assert } from './assert';
2
- import * as ES from './ecmascript';
3
- import { MakeIntrinsicClass } from './intrinsicclass';
4
- import {
5
- CAL_ID,
6
- CALENDAR,
7
- CreateSlots,
8
- DATE,
9
- DATETIME,
10
- DAYS,
11
- EPOCHNANOSECONDS,
12
- GetSlot,
13
- HasSlot,
14
- HOURS,
15
- INST,
16
- ISO_DATE,
17
- ISO_DATE_TIME,
18
- LOCALE,
19
- MD,
20
- MICROSECONDS,
21
- MILLISECONDS,
22
- MINUTES,
23
- MONTHS,
24
- NANOSECONDS,
25
- OPTIONS,
26
- ORIGINAL,
27
- ResetSlot,
28
- SECONDS,
29
- SetSlot,
30
- TIME,
31
- TIME_FMT,
32
- TZ_CANONICAL,
33
- TZ_ORIGINAL,
34
- WEEKS,
35
- YEARS,
36
- YM
37
- } from './slots';
38
- import type { Temporal } from '..';
39
- import type { DateTimeFormatParams as Params, DateTimeFormatReturn as Return } from './internaltypes';
40
-
41
- // Save the original Intl.DateTimeFormat, it will likely be overwritten
42
- const OriginalIntlDateTimeFormat = Intl.DateTimeFormat;
43
-
44
- type LazySlot = typeof DATE | typeof YM | typeof MD | typeof TIME_FMT | typeof DATETIME | typeof INST;
45
-
46
- // Construction of built-in Intl.DateTimeFormat objects is sloooooow,
47
- // so we'll only create those instances when we need them.
48
- // See https://bugs.chromium.org/p/v8/issues/detail?id=6528
49
- function getSlotLazy(obj: DateTimeFormatImpl, slot: LazySlot) {
50
- let val = GetSlot(obj, slot);
51
- if (typeof val === 'function') {
52
- // If we get here, `val` is an "amender function". It will take the user's
53
- // options and transform them into suitable options to be passed into the
54
- // built-in (non-polyfill) Intl.DateTimeFormat constructor. These options
55
- // will vary depending on the Temporal type, so that's why we store separate
56
- // formatters in separate props on the polyfill's DateTimeFormat instances.
57
- // The efficiency happens because we don't create an (expensive) formatter
58
- // until the user calls toLocaleString for that Temporal type.
59
- val = new OriginalIntlDateTimeFormat(GetSlot(obj, LOCALE), val(GetSlot(obj, OPTIONS)));
60
- ResetSlot(obj, slot, val);
61
- }
62
- return val;
63
- }
64
-
65
- function createDateTimeFormat(
66
- dtf: DateTimeFormatImpl,
67
- locale: Params['constructor'][0],
68
- optionsParam: Params['constructor'][1]
69
- ) {
70
- const hasOptions = typeof optionsParam !== 'undefined';
71
- let options: Intl.DateTimeFormatOptions;
72
- if (hasOptions) {
73
- // Read all the options in the expected order and copy them to a
74
- // null-prototype object with which we can do further operations
75
- // unobservably
76
- const props: (keyof Intl.DateTimeFormatOptions)[] = [
77
- 'localeMatcher',
78
- 'calendar',
79
- 'numberingSystem',
80
- 'hour12',
81
- 'hourCycle',
82
- 'timeZone',
83
- 'weekday',
84
- 'era',
85
- 'year',
86
- 'month',
87
- 'day',
88
- 'dayPeriod',
89
- 'hour',
90
- 'minute',
91
- 'second',
92
- 'fractionalSecondDigits',
93
- 'timeZoneName',
94
- 'formatMatcher',
95
- 'dateStyle',
96
- 'timeStyle'
97
- ];
98
- options = ES.ToObject(optionsParam);
99
- const newOptions = Object.create(null);
100
- for (let i = 0; i < props.length; i++) {
101
- const prop = props[i];
102
- if (Object.prototype.hasOwnProperty.call(options, prop)) {
103
- newOptions[prop] = options[prop];
104
- }
105
- }
106
- options = newOptions;
107
- } else {
108
- options = Object.create(null);
109
- }
110
- const original = new OriginalIntlDateTimeFormat(locale, options);
111
- const ro = original.resolvedOptions();
112
-
113
- CreateSlots(dtf);
114
-
115
- // DateTimeFormat instances are very expensive to create. Therefore, they will
116
- // be lazily created only when needed, using the locale and options provided.
117
- // But it's possible for callers to mutate those inputs before lazy creation
118
- // happens. For this reason, we clone the inputs instead of caching the
119
- // original objects. To avoid the complexity of deep cloning any inputs that
120
- // are themselves objects (e.g. the locales array, or options property values
121
- // that will be coerced to strings), we rely on `resolvedOptions()` to do the
122
- // coercion and cloning for us. Unfortunately, we can't just use the resolved
123
- // options as-is because our options-amending logic adds additional fields if
124
- // the user doesn't supply any unit fields like year, month, day, hour, etc.
125
- // Therefore, we limit the properties in the clone to properties that were
126
- // present in the original input.
127
- if (hasOptions) {
128
- const clonedResolved = Object.assign(Object.create(null), ro);
129
- for (const prop in clonedResolved) {
130
- if (!Object.prototype.hasOwnProperty.call(options, prop)) {
131
- delete clonedResolved[prop as keyof typeof clonedResolved];
132
- }
133
- }
134
- // hour12/hourCycle don't show up in resolvedOptions() unless the chosen
135
- // format includes an hour component, so copy them explicitly in case they
136
- // would otherwise be lost
137
- clonedResolved.hour12 = options.hour12;
138
- clonedResolved.hourCycle = options.hourCycle;
139
- SetSlot(dtf, OPTIONS, clonedResolved);
140
- } else {
141
- SetSlot(dtf, OPTIONS, options);
142
- }
143
-
144
- SetSlot(dtf, LOCALE, ro.locale);
145
- SetSlot(dtf, ORIGINAL, original);
146
- SetSlot(dtf, TZ_CANONICAL, ro.timeZone);
147
- SetSlot(dtf, CAL_ID, ro.calendar);
148
- SetSlot(dtf, DATE, dateAmend);
149
- SetSlot(dtf, YM, yearMonthAmend);
150
- SetSlot(dtf, MD, monthDayAmend);
151
- SetSlot(dtf, TIME_FMT, timeAmend);
152
- SetSlot(dtf, DATETIME, datetimeAmend);
153
- SetSlot(dtf, INST, instantAmend);
154
-
155
- // Save the original time zone, for a few reasons:
156
- // - Clearer error messages
157
- // - More clearly follows the spec for InitializeDateTimeFormat
158
- // - Because it follows the spec more closely, will make it easier to integrate
159
- // support of offset strings and other potential changes like proposal-canonical-tz.
160
- const timeZoneOption = hasOptions ? options.timeZone : undefined;
161
- if (timeZoneOption === undefined) {
162
- SetSlot(dtf, TZ_ORIGINAL, ro.timeZone);
163
- } else {
164
- const id = ES.ToString(timeZoneOption);
165
- if (id.startsWith('−')) {
166
- // The initial (Node 23) implementation of offset time zones allowed use
167
- // of the Unicode minus sign, which was disallowed by a later spec change.
168
- throw new RangeError('Unicode minus (U+2212) is not supported in time zone offsets');
169
- }
170
- // store a normalized identifier
171
- SetSlot(dtf, TZ_ORIGINAL, ES.ToTemporalTimeZoneIdentifier(id));
172
- }
173
- return undefined; // TODO: I couldn't satisfy TS without adding this. Is there another way?
174
- }
175
-
176
- function IsPatchedDateTimeFormat(item: unknown): item is DateTimeFormatImpl {
177
- return HasSlot(item, ORIGINAL);
178
- }
179
-
180
- class DateTimeFormatImpl {
181
- constructor(locales: Params['constructor'][0] = undefined, options: Params['constructor'][1] = undefined) {
182
- createDateTimeFormat(this, locales, options);
183
- }
184
-
185
- get format() {
186
- ES.CheckReceiver(this, IsPatchedDateTimeFormat);
187
- const boundFormat = format.bind(this);
188
- Object.defineProperties(boundFormat, {
189
- length: { value: 1, enumerable: false, writable: false, configurable: true },
190
- name: { value: '', enumerable: false, writable: false, configurable: true }
191
- });
192
- return boundFormat;
193
- }
194
-
195
- formatRange(a: Params['formatRange'][0], b: Params['formatRange'][1]): Return['formatRange'] {
196
- ES.CheckReceiver(this, IsPatchedDateTimeFormat);
197
- return formatRange.call(this, a, b);
198
- }
199
-
200
- formatToParts?<P extends readonly unknown[]>(
201
- datetime: Params['formatToParts'][0],
202
- ...rest: P
203
- ): Return['formatToParts'] {
204
- ES.CheckReceiver(this, IsPatchedDateTimeFormat);
205
- return formatToParts.call(this, datetime, ...rest);
206
- }
207
-
208
- formatRangeToParts?(
209
- a: Params['formatRangeToParts'][0],
210
- b: Params['formatRangeToParts'][1]
211
- ): Return['formatRangeToParts'] {
212
- ES.CheckReceiver(this, IsPatchedDateTimeFormat);
213
- return formatRangeToParts.call(this, a, b);
214
- }
215
-
216
- resolvedOptions(): Return['resolvedOptions'] {
217
- ES.CheckReceiver(this, IsPatchedDateTimeFormat);
218
- return resolvedOptions.call(this);
219
- }
220
- }
221
-
222
- if (!('formatToParts' in OriginalIntlDateTimeFormat.prototype)) {
223
- delete DateTimeFormatImpl.prototype.formatToParts;
224
- }
225
-
226
- if (!('formatRangeToParts' in OriginalIntlDateTimeFormat.prototype)) {
227
- delete DateTimeFormatImpl.prototype.formatRangeToParts;
228
- }
229
- export type { DateTimeFormatImpl };
230
-
231
- interface DateTimeFormatInterface {
232
- (locales: Params['constructor'][0], options: Params['constructor'][1]): DateTimeFormatImpl;
233
- new (locales: Params['constructor'][0], options: Params['constructor'][1]): DateTimeFormatImpl;
234
- supportedLocalesOf: typeof Intl.DateTimeFormat.supportedLocalesOf;
235
- }
236
-
237
- // A non-class constructor is needed because Intl.DateTimeFormat must be able to
238
- // be called without 'new'
239
- export const DateTimeFormat = function (
240
- locales: Params['constructor'][0] = undefined,
241
- options: Params['constructor'][1] = undefined
242
- ): DateTimeFormatImpl {
243
- return new DateTimeFormatImpl(locales, options);
244
- } as unknown as DateTimeFormatInterface;
245
- DateTimeFormatImpl.prototype.constructor = DateTimeFormat;
246
-
247
- Object.defineProperty(DateTimeFormat, 'prototype', {
248
- value: DateTimeFormatImpl.prototype,
249
- writable: false,
250
- enumerable: false,
251
- configurable: false
252
- });
253
- DateTimeFormat.supportedLocalesOf = OriginalIntlDateTimeFormat.supportedLocalesOf;
254
- MakeIntrinsicClass(DateTimeFormat as unknown as typeof Intl.DateTimeFormat, 'Intl.DateTimeFormat');
255
-
256
- function resolvedOptions(this: DateTimeFormatImpl): Return['resolvedOptions'] {
257
- const resolved = GetSlot(this, ORIGINAL).resolvedOptions();
258
- resolved.timeZone = GetSlot(this, TZ_ORIGINAL);
259
- return resolved;
260
- }
261
-
262
- // TODO: investigate why there's a rest parameter here. Does this function really need to accept extra params?
263
- // And if so, why doesn't formatRange also accept extra params?
264
- function format<P extends readonly unknown[]>(
265
- this: DateTimeFormatImpl,
266
- datetime: Params['format'][0],
267
- ...rest: P
268
- ): Return['format'] {
269
- let overrides = extractOverrides(datetime, this);
270
- let formatter, formatArgs: [Params['format'][0], ...unknown[]];
271
- if (overrides.formatter) {
272
- formatter = overrides.formatter;
273
- formatArgs = [ES.epochNsToMs(overrides.epochNs, 'floor')];
274
- } else {
275
- formatter = GetSlot(this, ORIGINAL);
276
- formatArgs = [datetime, ...rest];
277
- }
278
- return formatter.format(...(formatArgs as [number | Date | undefined]));
279
- }
280
-
281
- function formatToParts<P extends readonly unknown[]>(
282
- this: DateTimeFormatImpl,
283
- datetime: Params['formatToParts'][0],
284
- ...rest: P
285
- ): Return['formatToParts'] {
286
- let overrides = extractOverrides(datetime, this);
287
- let formatter, formatArgs;
288
- if (overrides.formatter) {
289
- formatter = overrides.formatter;
290
- formatArgs = [ES.epochNsToMs(overrides.epochNs, 'floor')];
291
- } else {
292
- formatter = GetSlot(this, ORIGINAL);
293
- formatArgs = [datetime, ...rest];
294
- }
295
- return formatter.formatToParts(...(formatArgs as [number | Date | undefined]));
296
- }
297
-
298
- function formatRange(this: DateTimeFormatImpl, aParam: Params['formatRange'][0], bParam: Params['formatRange'][1]) {
299
- if (aParam === undefined || bParam === undefined) {
300
- throw new TypeError('Intl.DateTimeFormat.formatRange requires two values');
301
- }
302
- const a = toDateTimeFormattable(aParam);
303
- const b = toDateTimeFormattable(bParam);
304
- let formatArgs = [a, b] as const;
305
- let formatter;
306
- if (isTemporalObject(a) !== isTemporalObject(b)) {
307
- throw new TypeError('Intl.DateTimeFormat.formatRange accepts two values of the same type');
308
- }
309
- if (isTemporalObject(a)) {
310
- if (!sameTemporalType(a, b)) {
311
- throw new TypeError('Intl.DateTimeFormat.formatRange accepts two values of the same type');
312
- }
313
- const { epochNs: aa, formatter: aformatter } = extractOverrides(a, this);
314
- const { epochNs: bb, formatter: bformatter } = extractOverrides(b, this);
315
- if (aformatter) {
316
- assert(bformatter == aformatter, 'formatters for same Temporal type should be identical');
317
- formatter = aformatter;
318
- formatArgs = [ES.epochNsToMs(aa, 'floor'), ES.epochNsToMs(bb, 'floor')];
319
- }
320
- }
321
- if (!formatter) {
322
- formatter = GetSlot(this, ORIGINAL);
323
- }
324
- return formatter.formatRange(...(formatArgs as [number, number]));
325
- }
326
-
327
- function formatRangeToParts(
328
- this: DateTimeFormatImpl,
329
- aParam: Params['formatRangeToParts'][0],
330
- bParam: Params['formatRangeToParts'][1]
331
- ) {
332
- if (aParam === undefined || bParam === undefined) {
333
- throw new TypeError('Intl.DateTimeFormat.formatRange requires two values');
334
- }
335
- const a = toDateTimeFormattable(aParam);
336
- const b = toDateTimeFormattable(bParam);
337
- let formatArgs = [a, b] as const;
338
- let formatter;
339
- if (isTemporalObject(a) !== isTemporalObject(b)) {
340
- throw new TypeError('Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type');
341
- }
342
- if (isTemporalObject(a)) {
343
- if (!sameTemporalType(a, b)) {
344
- throw new TypeError('Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type');
345
- }
346
- const { epochNs: aa, formatter: aformatter } = extractOverrides(a, this);
347
- const { epochNs: bb, formatter: bformatter } = extractOverrides(b, this);
348
- if (aformatter) {
349
- assert(bformatter == aformatter, 'formatters for same Temporal type should be identical');
350
- formatter = aformatter;
351
- formatArgs = [ES.epochNsToMs(aa, 'floor'), ES.epochNsToMs(bb, 'floor')];
352
- }
353
- }
354
- if (!formatter) {
355
- formatter = GetSlot(this, ORIGINAL);
356
- }
357
- return formatter.formatRangeToParts(...(formatArgs as [number, number]));
358
- }
359
-
360
- // "false" is a signal to delete this option
361
- type MaybeFalseOptions = {
362
- [K in keyof Intl.DateTimeFormatOptions]?: Intl.DateTimeFormatOptions[K] | false;
363
- };
364
-
365
- function amend(optionsParam: Intl.DateTimeFormatOptions = {}, amended: MaybeFalseOptions = {}) {
366
- const options = Object.assign({}, optionsParam);
367
- const props = [
368
- 'year',
369
- 'month',
370
- 'day',
371
- 'hour',
372
- 'minute',
373
- 'second',
374
- 'weekday',
375
- 'dayPeriod',
376
- 'timeZoneName',
377
- 'dateStyle',
378
- 'timeStyle'
379
- ] as const;
380
- for (let i = 0; i < props.length; i++) {
381
- const opt = props[i];
382
- // TODO: can this be typed more cleanly?
383
- type OptionMaybeFalse = (typeof options)[typeof opt] | false;
384
- (options[opt] as OptionMaybeFalse) = opt in amended ? amended[opt] : options[opt];
385
- if ((options[opt] as OptionMaybeFalse) === false || options[opt] === undefined) delete options[opt];
386
- }
387
- return options;
388
- }
389
-
390
- type OptionsType<T extends TypesWithToLocaleString> = NonNullable<Parameters<T['toLocaleString']>[1]>;
391
-
392
- function timeAmend(originalOptions: OptionsType<Temporal.PlainTime>) {
393
- const options = amend(originalOptions, {
394
- year: false,
395
- month: false,
396
- day: false,
397
- weekday: false,
398
- timeZoneName: false,
399
- dateStyle: false
400
- });
401
- if (options.timeStyle === 'long' || options.timeStyle === 'full') {
402
- // Try to fake what timeStyle should do if not printing the time zone name
403
- delete options.timeStyle;
404
- Object.assign(options, { hour: 'numeric', minute: '2-digit', second: '2-digit' });
405
- }
406
- if (!hasTimeOptions(options)) {
407
- if (hasAnyDateTimeOptions(originalOptions)) {
408
- throw new TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(originalOptions)}]`);
409
- }
410
- Object.assign(options, {
411
- hour: 'numeric',
412
- minute: 'numeric',
413
- second: 'numeric'
414
- });
415
- }
416
- return options;
417
- }
418
-
419
- function yearMonthAmend(originalOptions: OptionsType<Temporal.PlainYearMonth>) {
420
- // Try to fake what dateStyle should do for dates without a day. This is not
421
- // accurate for locales that always print the era
422
- const dateStyleHacks = {
423
- short: { year: '2-digit', month: 'numeric' },
424
- medium: { year: 'numeric', month: 'short' },
425
- long: { year: 'numeric', month: 'long' },
426
- full: { year: 'numeric', month: 'long' }
427
- };
428
- const options = amend(originalOptions, {
429
- day: false,
430
- hour: false,
431
- minute: false,
432
- second: false,
433
- weekday: false,
434
- dayPeriod: false,
435
- timeZoneName: false,
436
- timeStyle: false
437
- });
438
- if ('dateStyle' in options && options.dateStyle) {
439
- const style = options.dateStyle;
440
- delete options.dateStyle;
441
- Object.assign(options, dateStyleHacks[style]);
442
- }
443
- if (!('year' in options || 'month' in options || 'era' in options)) {
444
- if (hasAnyDateTimeOptions(originalOptions)) {
445
- throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(originalOptions)}]`);
446
- }
447
- Object.assign(options, { year: 'numeric', month: 'numeric' });
448
- }
449
- return options;
450
- }
451
-
452
- function monthDayAmend(originalOptions: OptionsType<Temporal.PlainMonthDay>) {
453
- // Try to fake what dateStyle should do for dates without a day
454
- const dateStyleHacks = {
455
- short: { month: 'numeric', day: 'numeric' },
456
- medium: { month: 'short', day: 'numeric' },
457
- long: { month: 'long', day: 'numeric' },
458
- full: { month: 'long', day: 'numeric' }
459
- };
460
- const options = amend(originalOptions, {
461
- year: false,
462
- hour: false,
463
- minute: false,
464
- second: false,
465
- weekday: false,
466
- dayPeriod: false,
467
- timeZoneName: false,
468
- timeStyle: false
469
- });
470
- if ('dateStyle' in options && options.dateStyle) {
471
- const style = options.dateStyle;
472
- delete options.dateStyle;
473
- Object.assign(options, dateStyleHacks[style]);
474
- }
475
- if (!('month' in options || 'day' in options)) {
476
- if (hasAnyDateTimeOptions(originalOptions)) {
477
- throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(originalOptions)}]`);
478
- }
479
- Object.assign(options, { month: 'numeric', day: 'numeric' });
480
- }
481
- return options;
482
- }
483
-
484
- function dateAmend(originalOptions: OptionsType<Temporal.PlainDate>) {
485
- const options = amend(originalOptions, {
486
- hour: false,
487
- minute: false,
488
- second: false,
489
- dayPeriod: false,
490
- timeZoneName: false,
491
- timeStyle: false
492
- });
493
- if (!hasDateOptions(options)) {
494
- if (hasAnyDateTimeOptions(originalOptions)) {
495
- throw new TypeError(`cannot format PlainDate with options [${Object.keys(originalOptions)}]`);
496
- }
497
- Object.assign(options, {
498
- year: 'numeric',
499
- month: 'numeric',
500
- day: 'numeric'
501
- });
502
- }
503
- return options;
504
- }
505
-
506
- function datetimeAmend(originalOptions: OptionsType<Temporal.PlainDateTime>) {
507
- const options = amend(originalOptions, { timeZoneName: false });
508
- if (options.timeStyle === 'long' || options.timeStyle === 'full') {
509
- // Try to fake what timeStyle should do if not printing the time zone name
510
- delete options.timeStyle;
511
- Object.assign(options, { hour: 'numeric', minute: '2-digit', second: '2-digit' });
512
-
513
- // If moving to a fake timeStyle while dateStyle is present, we also have to
514
- // move to a fake dateStyle. dateStyle is mutually exclusive with hour etc.
515
- if (options.dateStyle) {
516
- const dateStyleHacks = {
517
- short: { year: 'numeric', month: 'numeric', day: 'numeric' },
518
- medium: { year: 'numeric', month: 'short', day: 'numeric' },
519
- long: { year: 'numeric', month: 'long', day: 'numeric' },
520
- full: { year: 'numeric', month: 'long', day: 'numeric', weekday: 'long' }
521
- };
522
- Object.assign(options, dateStyleHacks[options.dateStyle]);
523
- delete options.dateStyle;
524
- }
525
- }
526
- if (!hasTimeOptions(options) && !hasDateOptions(options)) {
527
- if (hasAnyDateTimeOptions(originalOptions)) {
528
- throw new TypeError(`cannot format PlainDateTime with options [${Object.keys(originalOptions)}]`);
529
- }
530
- Object.assign(options, {
531
- year: 'numeric',
532
- month: 'numeric',
533
- day: 'numeric',
534
- hour: 'numeric',
535
- minute: 'numeric',
536
- second: 'numeric'
537
- });
538
- }
539
- return options;
540
- }
541
-
542
- function instantAmend(optionsParam: OptionsType<Temporal.Instant>) {
543
- let options = optionsParam;
544
- if (!hasTimeOptions(options) && !hasDateOptions(options)) {
545
- options = Object.assign({}, options, {
546
- year: 'numeric',
547
- month: 'numeric',
548
- day: 'numeric',
549
- hour: 'numeric',
550
- minute: 'numeric',
551
- second: 'numeric'
552
- });
553
- }
554
- return options;
555
- }
556
-
557
- function hasDateOptions(options: OptionsType<TypesWithToLocaleString>) {
558
- return (
559
- 'year' in options ||
560
- 'month' in options ||
561
- 'day' in options ||
562
- 'weekday' in options ||
563
- 'dateStyle' in options ||
564
- 'era' in options
565
- );
566
- }
567
-
568
- function hasTimeOptions(options: OptionsType<TypesWithToLocaleString>) {
569
- return (
570
- 'hour' in options ||
571
- 'minute' in options ||
572
- 'second' in options ||
573
- 'timeStyle' in options ||
574
- 'dayPeriod' in options ||
575
- 'fractionalSecondDigits' in options
576
- );
577
- }
578
-
579
- function hasAnyDateTimeOptions(originalOptions: OptionsType<TypesWithToLocaleString>) {
580
- return (
581
- hasDateOptions(originalOptions) ||
582
- hasTimeOptions(originalOptions) ||
583
- 'dateStyle' in originalOptions ||
584
- 'timeStyle' in originalOptions ||
585
- 'timeZoneName' in originalOptions
586
- );
587
- }
588
-
589
- function isTemporalObject(
590
- obj: unknown
591
- ): obj is
592
- | Temporal.PlainDate
593
- | Temporal.PlainTime
594
- | Temporal.PlainDateTime
595
- | Temporal.ZonedDateTime
596
- | Temporal.PlainYearMonth
597
- | Temporal.PlainMonthDay
598
- | Temporal.Instant {
599
- return (
600
- ES.IsTemporalDate(obj) ||
601
- ES.IsTemporalTime(obj) ||
602
- ES.IsTemporalDateTime(obj) ||
603
- ES.IsTemporalZonedDateTime(obj) ||
604
- ES.IsTemporalYearMonth(obj) ||
605
- ES.IsTemporalMonthDay(obj) ||
606
- ES.IsTemporalInstant(obj)
607
- );
608
- }
609
-
610
- function toDateTimeFormattable(value: unknown) {
611
- if (isTemporalObject(value)) return value;
612
- return ES.ToNumber(value);
613
- }
614
-
615
- function sameTemporalType(x: unknown, y: unknown) {
616
- if (!isTemporalObject(x) || !isTemporalObject(y)) return false;
617
- if (ES.IsTemporalTime(x) && !ES.IsTemporalTime(y)) return false;
618
- if (ES.IsTemporalDate(x) && !ES.IsTemporalDate(y)) return false;
619
- if (ES.IsTemporalDateTime(x) && !ES.IsTemporalDateTime(y)) return false;
620
- if (ES.IsTemporalZonedDateTime(x) && !ES.IsTemporalZonedDateTime(y)) return false;
621
- if (ES.IsTemporalYearMonth(x) && !ES.IsTemporalYearMonth(y)) return false;
622
- if (ES.IsTemporalMonthDay(x) && !ES.IsTemporalMonthDay(y)) return false;
623
- if (ES.IsTemporalInstant(x) && !ES.IsTemporalInstant(y)) return false;
624
- return true;
625
- }
626
-
627
- type TypesWithToLocaleString =
628
- | Temporal.PlainDateTime
629
- | Temporal.PlainDate
630
- | Temporal.PlainTime
631
- | Temporal.PlainYearMonth
632
- | Temporal.PlainMonthDay
633
- | Temporal.ZonedDateTime
634
- | Temporal.Instant;
635
-
636
- function extractOverrides(temporalObj: Params['format'][0], main: DateTimeFormatImpl) {
637
- if (ES.IsTemporalTime(temporalObj)) {
638
- const isoDateTime = {
639
- isoDate: { year: 1970, month: 1, day: 1 },
640
- time: GetSlot(temporalObj, TIME)
641
- };
642
- return {
643
- epochNs: ES.GetEpochNanosecondsFor(GetSlot(main, TZ_CANONICAL), isoDateTime, 'compatible'),
644
- formatter: getSlotLazy(main, TIME_FMT)
645
- };
646
- }
647
-
648
- if (ES.IsTemporalYearMonth(temporalObj)) {
649
- const calendar = GetSlot(temporalObj, CALENDAR);
650
- const mainCalendar = GetSlot(main, CAL_ID);
651
- if (calendar !== mainCalendar) {
652
- throw new RangeError(
653
- `cannot format PlainYearMonth with calendar ${calendar} in locale with calendar ${mainCalendar}`
654
- );
655
- }
656
- const isoDateTime = ES.CombineISODateAndTimeRecord(GetSlot(temporalObj, ISO_DATE), ES.NoonTimeRecord());
657
- return {
658
- epochNs: ES.GetEpochNanosecondsFor(GetSlot(main, TZ_CANONICAL), isoDateTime, 'compatible'),
659
- formatter: getSlotLazy(main, YM)
660
- };
661
- }
662
-
663
- if (ES.IsTemporalMonthDay(temporalObj)) {
664
- const calendar = GetSlot(temporalObj, CALENDAR);
665
- const mainCalendar = GetSlot(main, CAL_ID);
666
- if (calendar !== mainCalendar) {
667
- throw new RangeError(
668
- `cannot format PlainMonthDay with calendar ${calendar} in locale with calendar ${mainCalendar}`
669
- );
670
- }
671
- const isoDateTime = ES.CombineISODateAndTimeRecord(GetSlot(temporalObj, ISO_DATE), ES.NoonTimeRecord());
672
- return {
673
- epochNs: ES.GetEpochNanosecondsFor(GetSlot(main, TZ_CANONICAL), isoDateTime, 'compatible'),
674
- formatter: getSlotLazy(main, MD)
675
- };
676
- }
677
-
678
- if (ES.IsTemporalDate(temporalObj)) {
679
- const calendar = GetSlot(temporalObj, CALENDAR);
680
- const mainCalendar = GetSlot(main, CAL_ID);
681
- if (calendar !== 'iso8601' && calendar !== mainCalendar) {
682
- throw new RangeError(`cannot format PlainDate with calendar ${calendar} in locale with calendar ${mainCalendar}`);
683
- }
684
- const isoDateTime = ES.CombineISODateAndTimeRecord(GetSlot(temporalObj, ISO_DATE), ES.NoonTimeRecord());
685
- return {
686
- epochNs: ES.GetEpochNanosecondsFor(GetSlot(main, TZ_CANONICAL), isoDateTime, 'compatible'),
687
- formatter: getSlotLazy(main, DATE)
688
- };
689
- }
690
-
691
- if (ES.IsTemporalDateTime(temporalObj)) {
692
- const calendar = GetSlot(temporalObj, CALENDAR);
693
- const mainCalendar = GetSlot(main, CAL_ID);
694
- if (calendar !== 'iso8601' && calendar !== mainCalendar) {
695
- throw new RangeError(
696
- `cannot format PlainDateTime with calendar ${calendar} in locale with calendar ${mainCalendar}`
697
- );
698
- }
699
- const isoDateTime = GetSlot(temporalObj, ISO_DATE_TIME);
700
- return {
701
- epochNs: ES.GetEpochNanosecondsFor(GetSlot(main, TZ_CANONICAL), isoDateTime, 'compatible'),
702
- formatter: getSlotLazy(main, DATETIME)
703
- };
704
- }
705
-
706
- if (ES.IsTemporalZonedDateTime(temporalObj)) {
707
- throw new TypeError(
708
- 'Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.'
709
- );
710
- }
711
-
712
- if (ES.IsTemporalInstant(temporalObj)) {
713
- return {
714
- epochNs: GetSlot(temporalObj, EPOCHNANOSECONDS),
715
- formatter: getSlotLazy(main, INST)
716
- };
717
- }
718
-
719
- return {};
720
- }
721
-
722
- function temporalDurationToCompatibilityRecord(duration: Temporal.Duration) {
723
- const record = Object.create(null);
724
- record.years = GetSlot(duration, YEARS);
725
- record.months = GetSlot(duration, MONTHS);
726
- record.weeks = GetSlot(duration, WEEKS);
727
- record.days = GetSlot(duration, DAYS);
728
- record.hours = GetSlot(duration, HOURS);
729
- record.minutes = GetSlot(duration, MINUTES);
730
- record.seconds = GetSlot(duration, SECONDS);
731
- record.milliseconds = GetSlot(duration, MILLISECONDS);
732
- record.microseconds = GetSlot(duration, MICROSECONDS);
733
- record.nanoseconds = GetSlot(duration, NANOSECONDS);
734
- return record;
735
- }
736
-
737
- const { format: IntlDurationFormatPrototypeFormat, formatToParts: IntlDurationFormatPrototypeFormatToParts } =
738
- Intl.DurationFormat?.prototype ?? Object.create(null);
739
-
740
- export function ModifiedIntlDurationFormatPrototypeFormat(
741
- this: Intl.DurationFormat,
742
- durationLike: Temporal.DurationLike
743
- ) {
744
- Intl.DurationFormat.prototype.resolvedOptions.call(this); // brand check
745
- const duration = ES.ToTemporalDuration(durationLike);
746
- const record = temporalDurationToCompatibilityRecord(duration);
747
- return IntlDurationFormatPrototypeFormat.call(this, record);
748
- }
749
-
750
- if (Intl.DurationFormat?.prototype) {
751
- Intl.DurationFormat.prototype.format = ModifiedIntlDurationFormatPrototypeFormat;
752
- Intl.DurationFormat.prototype.formatToParts = function formatToParts(durationLike: Temporal.DurationLike) {
753
- Intl.DurationFormat.prototype.resolvedOptions.call(this); // brand check
754
- const duration = ES.ToTemporalDuration(durationLike);
755
- const record = temporalDurationToCompatibilityRecord(duration);
756
- return IntlDurationFormatPrototypeFormatToParts.call(this, record);
757
- };
758
- }