@nubjs/nub-linux-x64 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/nub +0 -0
- package/package.json +1 -1
- package/runtime/addons/nub-native.node +0 -0
- package/runtime/node_modules/@js-temporal/polyfill/CHANGELOG.md +453 -0
- package/runtime/node_modules/@js-temporal/polyfill/LICENSE +13 -0
- package/runtime/node_modules/@js-temporal/polyfill/README.md +90 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs +2 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs.map +1 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js +2 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js.map +1 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js +2 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js.map +1 -0
- package/runtime/node_modules/@js-temporal/polyfill/index.d.cts +1215 -0
- package/runtime/node_modules/@js-temporal/polyfill/index.d.ts +1215 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/assert.ts +8 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +39 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/calendar.ts +2424 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/debug.ts +7 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/duration.ts +438 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/durationformat.d.ts +93 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +4973 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/index.ts +34 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/init.ts +43 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/instant.ts +138 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/internaltypes.d.ts +242 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/intl.ts +758 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +162 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/legacydate.ts +17 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/math.ts +96 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/now.ts +48 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plaindate.ts +212 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +274 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +110 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plaintime.ts +154 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +157 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/regex.ts +59 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/slots.ts +341 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/temporal.ts +10 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/timeduration.ts +149 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +492 -0
- package/runtime/node_modules/@js-temporal/polyfill/package.json +143 -0
- package/runtime/node_modules/@oxc-project/runtime/CHANGELOG.md +88 -0
- package/runtime/node_modules/@oxc-project/runtime/LICENSE +22 -0
- package/runtime/node_modules/@oxc-project/runtime/README.md +5 -0
- package/runtime/node_modules/@oxc-project/runtime/package.json +1066 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/AwaitValue.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecoratedDescriptor.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs.js +236 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203.js +184 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203R.js +191 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2301.js +222 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2305.js +133 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2311.js +124 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayLikeToArray.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithHoles.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithoutHoles.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertClassBrand.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertThisInitialized.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js +24 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js +45 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js +26 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/callSuper.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkInRHS.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkPrivateRedeclaration.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorDestructureSet.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorGet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCallCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticAccess.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classExtractFieldDescriptor.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classNameTDZError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseBase.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseKey.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateGetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateSetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/construct.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createClass.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelper.js +50 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelperLoose.js +19 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createSuper.js +16 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorate.js +23 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateMetadata.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateParam.js +11 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defaults.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineAccessor.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineEnumerableProperties.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/dispose.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/AwaitValue.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/OverloadYield.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecoratedDescriptor.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs.js +236 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203.js +184 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203R.js +191 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2301.js +222 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2305.js +133 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2311.js +124 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayLikeToArray.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithHoles.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithoutHoles.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertClassBrand.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertThisInitialized.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncGeneratorDelegate.js +24 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncIterator.js +45 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncToGenerator.js +26 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/awaitAsyncGenerator.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/callSuper.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkInRHS.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkPrivateRedeclaration.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorDestructureSet.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorGet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCallCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticAccess.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classExtractFieldDescriptor.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classNameTDZError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseBase.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseKey.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateGetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateSetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/construct.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createClass.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelper.js +50 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelperLoose.js +19 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createSuper.js +16 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorate.js +21 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateMetadata.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateParam.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defaults.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineAccessor.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineEnumerableProperties.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/dispose.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/extends.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/get.js +11 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/getPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/identity.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/importDeferProxy.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inherits.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inheritsLoose.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerDefineProperty.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerWarningHelper.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/instanceof.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireDefault.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireWildcard.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeFunction.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeReflectConstruct.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArray.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArrayLimit.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/jsx.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/maybeArrayLike.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/newArrowCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableRest.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableSpread.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nullishReceiverError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectDestructuringEmpty.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread2.js +23 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutProperties.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutPropertiesLoose.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/package.json +3 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/possibleConstructorReturn.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/readOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/regeneratorRuntime.js +304 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/set.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setFunctionName.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/skipFirstGeneratorNext.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/slicedToArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropBase.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropGet.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropSet.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteral.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteralLoose.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/tdz.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalRef.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalUndefined.js +2 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toConsumableArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toSetter.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/unsupportedIterableToArray.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/using.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/usingCtx.js +59 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapAsyncGenerator.js +69 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapNativeSuper.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapRegExp.js +51 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/writeOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/extends.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/get.js +11 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/getPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/identity.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/importDeferProxy.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/inherits.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/inheritsLoose.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerDefineProperty.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerWarningHelper.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/instanceof.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireDefault.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireWildcard.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeFunction.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeReflectConstruct.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArray.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArrayLimit.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/jsx.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/maybeArrayLike.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/newArrowCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableRest.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableSpread.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/nullishReceiverError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectDestructuringEmpty.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js +23 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/possibleConstructorReturn.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/readOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/regeneratorRuntime.js +304 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/set.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/setFunctionName.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/setPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/skipFirstGeneratorNext.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/slicedToArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropBase.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropGet.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropSet.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteral.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteralLoose.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/tdz.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalRef.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalUndefined.js +2 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toConsumableArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toSetter.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/typeof.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/unsupportedIterableToArray.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/using.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js +59 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js +69 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapNativeSuper.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapRegExp.js +51 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/writeOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/types/LICENSE +22 -0
- package/runtime/node_modules/@oxc-project/types/README.md +3 -0
- package/runtime/node_modules/@oxc-project/types/package.json +26 -0
- package/runtime/node_modules/@oxc-project/types/types.d.ts +1912 -0
- package/runtime/node_modules/@petamoriken/float16/LICENSE +21 -0
- package/runtime/node_modules/@petamoriken/float16/README.md +413 -0
- package/runtime/node_modules/@petamoriken/float16/browser/float16.js +1340 -0
- package/runtime/node_modules/@petamoriken/float16/browser/float16.mjs +1325 -0
- package/runtime/node_modules/@petamoriken/float16/index.d.ts +546 -0
- package/runtime/node_modules/@petamoriken/float16/index.v5.6.d.ts +546 -0
- package/runtime/node_modules/@petamoriken/float16/index.v5.7.d.ts +555 -0
- package/runtime/node_modules/@petamoriken/float16/inspect/node.cjs +25 -0
- package/runtime/node_modules/@petamoriken/float16/inspect/node.mjs +23 -0
- package/runtime/node_modules/@petamoriken/float16/lib/DataView.cjs +16 -0
- package/runtime/node_modules/@petamoriken/float16/lib/Float16Array.cjs +690 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/arrayIterator.cjs +52 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/brand.cjs +27 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/converter.cjs +111 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/is.cjs +78 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/messages.cjs +18 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/primordials.cjs +150 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/spec.cjs +84 -0
- package/runtime/node_modules/@petamoriken/float16/lib/f16round.cjs +10 -0
- package/runtime/node_modules/@petamoriken/float16/lib/index.cjs +16 -0
- package/runtime/node_modules/@petamoriken/float16/lib/isTypedArray.cjs +11 -0
- package/runtime/node_modules/@petamoriken/float16/package.json +115 -0
- package/runtime/node_modules/@petamoriken/float16/src/DataView.mjs +35 -0
- package/runtime/node_modules/@petamoriken/float16/src/Float16Array.mjs +1194 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/arrayIterator.mjs +86 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/brand.mjs +31 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/converter.mjs +173 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/is.mjs +151 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/messages.mjs +22 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/primordials.mjs +254 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/spec.mjs +137 -0
- package/runtime/node_modules/@petamoriken/float16/src/f16round.mjs +10 -0
- package/runtime/node_modules/@petamoriken/float16/src/index.mjs +7 -0
- package/runtime/node_modules/@petamoriken/float16/src/isTypedArray.mjs +10 -0
- package/runtime/node_modules/get-tsconfig/LICENSE +21 -0
- package/runtime/node_modules/get-tsconfig/README.md +268 -0
- package/runtime/node_modules/get-tsconfig/dist/index.cjs +7 -0
- package/runtime/node_modules/get-tsconfig/dist/index.d.cts +2116 -0
- package/runtime/node_modules/get-tsconfig/dist/index.d.mts +2116 -0
- package/runtime/node_modules/get-tsconfig/dist/index.mjs +7 -0
- package/runtime/node_modules/get-tsconfig/package.json +46 -0
- package/runtime/node_modules/jsbi/LICENSE +176 -0
- package/runtime/node_modules/jsbi/README.md +173 -0
- package/runtime/node_modules/jsbi/dist/jsbi-cjs.js +2 -0
- package/runtime/node_modules/jsbi/dist/jsbi-cjs.js.map +1 -0
- package/runtime/node_modules/jsbi/dist/jsbi-umd.js +2 -0
- package/runtime/node_modules/jsbi/dist/jsbi-umd.js.map +1 -0
- package/runtime/node_modules/jsbi/dist/jsbi.mjs +2 -0
- package/runtime/node_modules/jsbi/dist/jsbi.mjs.map +1 -0
- package/runtime/node_modules/jsbi/jsbi.d.ts +43 -0
- package/runtime/node_modules/jsbi/package.json +35 -0
- package/runtime/node_modules/oxc-parser/LICENSE +22 -0
- package/runtime/node_modules/oxc-parser/README.md +167 -0
- package/runtime/node_modules/oxc-parser/package.json +153 -0
- package/runtime/node_modules/oxc-parser/src-js/bindings.js +601 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/constants.js +105 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/js.js +5862 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/js_range.js +6403 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/ts.js +6154 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/ts_range.js +6723 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/lazy/constructors.js +13875 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/lazy/type_ids.js +191 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/lazy/walk.js +5810 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/keys.js +220 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/type_ids.js +177 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts +387 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/walk.js +2455 -0
- package/runtime/node_modules/oxc-parser/src-js/index.d.ts +312 -0
- package/runtime/node_modules/oxc-parser/src-js/index.js +108 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/common.js +301 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/eager.js +255 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/lazy-common.js +11 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/lazy.js +162 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/node-array.js +365 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/supported.js +52 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/visitor.js +127 -0
- package/runtime/node_modules/oxc-parser/src-js/visit/index.js +41 -0
- package/runtime/node_modules/oxc-parser/src-js/visit/visitor.js +405 -0
- package/runtime/node_modules/oxc-parser/src-js/wasm.js +13 -0
- package/runtime/node_modules/oxc-parser/src-js/webcontainer-fallback.cjs +21 -0
- package/runtime/node_modules/oxc-parser/src-js/wrap.js +57 -0
- package/runtime/node_modules/oxc-transform/LICENSE +22 -0
- package/runtime/node_modules/oxc-transform/README.md +84 -0
- package/runtime/node_modules/oxc-transform/browser.js +1 -0
- package/runtime/node_modules/oxc-transform/index.d.ts +658 -0
- package/runtime/node_modules/oxc-transform/index.js +598 -0
- package/runtime/node_modules/oxc-transform/package.json +114 -0
- package/runtime/node_modules/oxc-transform/webcontainer-fallback.cjs +21 -0
- package/runtime/node_modules/resolve-pkg-maps/LICENSE +21 -0
- package/runtime/node_modules/resolve-pkg-maps/README.md +216 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.cjs +1 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.d.cts +11 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.d.mts +11 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.mjs +1 -0
- package/runtime/node_modules/resolve-pkg-maps/package.json +42 -0
- package/runtime/node_modules/urlpattern-polyfill/LICENSE +19 -0
- package/runtime/node_modules/urlpattern-polyfill/README.md +242 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/index.d.ts +9 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/types.d.ts +49 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +1 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.js +1 -0
- package/runtime/node_modules/urlpattern-polyfill/index.cjs +7 -0
- package/runtime/node_modules/urlpattern-polyfill/index.js +7 -0
- package/runtime/node_modules/urlpattern-polyfill/package.json +149 -0
- package/runtime/version.mjs +1 -1
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import * as ES from './ecmascript';
|
|
2
|
+
import { MakeIntrinsicClass } from './intrinsicclass';
|
|
3
|
+
|
|
4
|
+
import { CALENDAR, GetSlot, ISO_DATE_TIME } from './slots';
|
|
5
|
+
import type { Temporal } from '..';
|
|
6
|
+
import { DateTimeFormat } from './intl';
|
|
7
|
+
import type { CalendarDateRecord, PlainDateTimeParams as Params, PlainDateTimeReturn as Return } from './internaltypes';
|
|
8
|
+
|
|
9
|
+
export class PlainDateTime implements Temporal.PlainDateTime {
|
|
10
|
+
constructor(
|
|
11
|
+
isoYear: Params['constructor'][0],
|
|
12
|
+
isoMonth: Params['constructor'][1],
|
|
13
|
+
isoDay: Params['constructor'][2],
|
|
14
|
+
hourParam: Params['constructor'][3] = 0,
|
|
15
|
+
minuteParam: Params['constructor'][4] = 0,
|
|
16
|
+
secondParam: Params['constructor'][5] = 0,
|
|
17
|
+
millisecondParam: Params['constructor'][6] = 0,
|
|
18
|
+
microsecondParam: Params['constructor'][7] = 0,
|
|
19
|
+
nanosecondParam: Params['constructor'][8] = 0,
|
|
20
|
+
calendarParam: Params['constructor'][9] = 'iso8601'
|
|
21
|
+
) {
|
|
22
|
+
const year = ES.ToIntegerWithTruncation(isoYear);
|
|
23
|
+
const month = ES.ToIntegerWithTruncation(isoMonth);
|
|
24
|
+
const day = ES.ToIntegerWithTruncation(isoDay);
|
|
25
|
+
const hour = hourParam === undefined ? 0 : ES.ToIntegerWithTruncation(hourParam);
|
|
26
|
+
const minute = minuteParam === undefined ? 0 : ES.ToIntegerWithTruncation(minuteParam);
|
|
27
|
+
const second = secondParam === undefined ? 0 : ES.ToIntegerWithTruncation(secondParam);
|
|
28
|
+
const millisecond = millisecondParam === undefined ? 0 : ES.ToIntegerWithTruncation(millisecondParam);
|
|
29
|
+
const microsecond = microsecondParam === undefined ? 0 : ES.ToIntegerWithTruncation(microsecondParam);
|
|
30
|
+
const nanosecond = nanosecondParam === undefined ? 0 : ES.ToIntegerWithTruncation(nanosecondParam);
|
|
31
|
+
const calendar = ES.CanonicalizeCalendar(calendarParam === undefined ? 'iso8601' : ES.RequireString(calendarParam));
|
|
32
|
+
|
|
33
|
+
ES.RejectDateTime(year, month, day, hour, minute, second, millisecond, microsecond, nanosecond);
|
|
34
|
+
|
|
35
|
+
ES.CreateTemporalDateTimeSlots(
|
|
36
|
+
this,
|
|
37
|
+
{ isoDate: { year, month, day }, time: { hour, minute, second, millisecond, microsecond, nanosecond } },
|
|
38
|
+
calendar
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
get calendarId(): Return['calendarId'] {
|
|
42
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
43
|
+
return GetSlot(this, CALENDAR);
|
|
44
|
+
}
|
|
45
|
+
get year(): Return['year'] {
|
|
46
|
+
return getCalendarProperty(this, 'year');
|
|
47
|
+
}
|
|
48
|
+
get month(): Return['month'] {
|
|
49
|
+
return getCalendarProperty(this, 'month');
|
|
50
|
+
}
|
|
51
|
+
get monthCode(): Return['monthCode'] {
|
|
52
|
+
return getCalendarProperty(this, 'monthCode');
|
|
53
|
+
}
|
|
54
|
+
get day(): Return['day'] {
|
|
55
|
+
return getCalendarProperty(this, 'day');
|
|
56
|
+
}
|
|
57
|
+
get hour(): Return['hour'] {
|
|
58
|
+
return getTimeProperty(this, 'hour');
|
|
59
|
+
}
|
|
60
|
+
get minute(): Return['minute'] {
|
|
61
|
+
return getTimeProperty(this, 'minute');
|
|
62
|
+
}
|
|
63
|
+
get second(): Return['second'] {
|
|
64
|
+
return getTimeProperty(this, 'second');
|
|
65
|
+
}
|
|
66
|
+
get millisecond(): Return['millisecond'] {
|
|
67
|
+
return getTimeProperty(this, 'millisecond');
|
|
68
|
+
}
|
|
69
|
+
get microsecond(): Return['microsecond'] {
|
|
70
|
+
return getTimeProperty(this, 'microsecond');
|
|
71
|
+
}
|
|
72
|
+
get nanosecond(): Return['nanosecond'] {
|
|
73
|
+
return getTimeProperty(this, 'nanosecond');
|
|
74
|
+
}
|
|
75
|
+
get era(): Return['era'] {
|
|
76
|
+
return getCalendarProperty(this, 'era');
|
|
77
|
+
}
|
|
78
|
+
get eraYear(): Return['eraYear'] {
|
|
79
|
+
return getCalendarProperty(this, 'eraYear');
|
|
80
|
+
}
|
|
81
|
+
get dayOfWeek(): Return['dayOfWeek'] {
|
|
82
|
+
return getCalendarProperty(this, 'dayOfWeek');
|
|
83
|
+
}
|
|
84
|
+
get dayOfYear(): Return['dayOfYear'] {
|
|
85
|
+
return getCalendarProperty(this, 'dayOfYear');
|
|
86
|
+
}
|
|
87
|
+
get weekOfYear(): Return['weekOfYear'] {
|
|
88
|
+
return getCalendarProperty(this, 'weekOfYear')?.week;
|
|
89
|
+
}
|
|
90
|
+
get yearOfWeek(): Return['yearOfWeek'] {
|
|
91
|
+
return getCalendarProperty(this, 'weekOfYear')?.year;
|
|
92
|
+
}
|
|
93
|
+
get daysInWeek(): Return['daysInWeek'] {
|
|
94
|
+
return getCalendarProperty(this, 'daysInWeek');
|
|
95
|
+
}
|
|
96
|
+
get daysInYear(): Return['daysInYear'] {
|
|
97
|
+
return getCalendarProperty(this, 'daysInYear');
|
|
98
|
+
}
|
|
99
|
+
get daysInMonth(): Return['daysInMonth'] {
|
|
100
|
+
return getCalendarProperty(this, 'daysInMonth');
|
|
101
|
+
}
|
|
102
|
+
get monthsInYear(): Return['monthsInYear'] {
|
|
103
|
+
return getCalendarProperty(this, 'monthsInYear');
|
|
104
|
+
}
|
|
105
|
+
get inLeapYear(): Return['inLeapYear'] {
|
|
106
|
+
return getCalendarProperty(this, 'inLeapYear');
|
|
107
|
+
}
|
|
108
|
+
with(temporalDateTimeLike: Params['with'][0], options: Params['with'][1] = undefined): Return['with'] {
|
|
109
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
110
|
+
if (!ES.IsObject(temporalDateTimeLike)) {
|
|
111
|
+
throw new TypeError('invalid argument');
|
|
112
|
+
}
|
|
113
|
+
ES.RejectTemporalLikeObject(temporalDateTimeLike);
|
|
114
|
+
|
|
115
|
+
const calendar = GetSlot(this, CALENDAR);
|
|
116
|
+
const isoDateTime = GetSlot(this, ISO_DATE_TIME);
|
|
117
|
+
let fields = {
|
|
118
|
+
...ES.ISODateToFields(calendar, isoDateTime.isoDate),
|
|
119
|
+
...isoDateTime.time
|
|
120
|
+
};
|
|
121
|
+
const partialDateTime = ES.PrepareCalendarFields(
|
|
122
|
+
calendar,
|
|
123
|
+
temporalDateTimeLike,
|
|
124
|
+
['year', 'month', 'monthCode', 'day'],
|
|
125
|
+
['hour', 'minute', 'second', 'millisecond', 'microsecond', 'nanosecond'],
|
|
126
|
+
'partial'
|
|
127
|
+
);
|
|
128
|
+
fields = ES.CalendarMergeFields(calendar, fields, partialDateTime);
|
|
129
|
+
|
|
130
|
+
const overflow = ES.GetTemporalOverflowOption(ES.GetOptionsObject(options));
|
|
131
|
+
const newDateTime = ES.InterpretTemporalDateTimeFields(calendar, fields, overflow);
|
|
132
|
+
return ES.CreateTemporalDateTime(newDateTime, calendar);
|
|
133
|
+
}
|
|
134
|
+
withPlainTime(temporalTime: Params['withPlainTime'][0] = undefined): Return['withPlainTime'] {
|
|
135
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
136
|
+
const time = ES.ToTimeRecordOrMidnight(temporalTime);
|
|
137
|
+
const isoDateTime = ES.CombineISODateAndTimeRecord(GetSlot(this, ISO_DATE_TIME).isoDate, time);
|
|
138
|
+
return ES.CreateTemporalDateTime(isoDateTime, GetSlot(this, CALENDAR));
|
|
139
|
+
}
|
|
140
|
+
withCalendar(calendarParam: Params['withCalendar'][0]): Return['withCalendar'] {
|
|
141
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
142
|
+
const calendar = ES.ToTemporalCalendarIdentifier(calendarParam);
|
|
143
|
+
return ES.CreateTemporalDateTime(GetSlot(this, ISO_DATE_TIME), calendar);
|
|
144
|
+
}
|
|
145
|
+
add(temporalDurationLike: Params['add'][0], options: Params['add'][1] = undefined): Return['add'] {
|
|
146
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
147
|
+
return ES.AddDurationToDateTime('add', this, temporalDurationLike, options);
|
|
148
|
+
}
|
|
149
|
+
subtract(
|
|
150
|
+
temporalDurationLike: Params['subtract'][0],
|
|
151
|
+
options: Params['subtract'][1] = undefined
|
|
152
|
+
): Return['subtract'] {
|
|
153
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
154
|
+
return ES.AddDurationToDateTime('subtract', this, temporalDurationLike, options);
|
|
155
|
+
}
|
|
156
|
+
until(other: Params['until'][0], options: Params['until'][1] = undefined): Return['until'] {
|
|
157
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
158
|
+
return ES.DifferenceTemporalPlainDateTime('until', this, other, options);
|
|
159
|
+
}
|
|
160
|
+
since(other: Params['since'][0], options: Params['since'][1] = undefined): Return['since'] {
|
|
161
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
162
|
+
return ES.DifferenceTemporalPlainDateTime('since', this, other, options);
|
|
163
|
+
}
|
|
164
|
+
round(roundToParam: Params['round'][0]): Return['round'] {
|
|
165
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
166
|
+
if (roundToParam === undefined) throw new TypeError('options parameter is required');
|
|
167
|
+
const roundTo =
|
|
168
|
+
typeof roundToParam === 'string'
|
|
169
|
+
? (ES.CreateOnePropObject('smallestUnit', roundToParam) as Exclude<typeof roundToParam, string>)
|
|
170
|
+
: ES.GetOptionsObject(roundToParam);
|
|
171
|
+
const roundingIncrement = ES.GetTemporalRoundingIncrementOption(roundTo);
|
|
172
|
+
const roundingMode = ES.GetRoundingModeOption(roundTo, 'halfExpand');
|
|
173
|
+
const smallestUnit = ES.GetTemporalUnitValuedOption(roundTo, 'smallestUnit', 'time', ES.REQUIRED, ['day']);
|
|
174
|
+
const maximumIncrements = {
|
|
175
|
+
day: 1,
|
|
176
|
+
hour: 24,
|
|
177
|
+
minute: 60,
|
|
178
|
+
second: 60,
|
|
179
|
+
millisecond: 1000,
|
|
180
|
+
microsecond: 1000,
|
|
181
|
+
nanosecond: 1000
|
|
182
|
+
};
|
|
183
|
+
const maximum = maximumIncrements[smallestUnit];
|
|
184
|
+
const inclusive = maximum === 1;
|
|
185
|
+
ES.ValidateTemporalRoundingIncrement(roundingIncrement, maximum, inclusive);
|
|
186
|
+
|
|
187
|
+
const isoDateTime = GetSlot(this, ISO_DATE_TIME);
|
|
188
|
+
if (roundingIncrement === 1 && smallestUnit === 'nanosecond') {
|
|
189
|
+
return ES.CreateTemporalDateTime(isoDateTime, GetSlot(this, CALENDAR));
|
|
190
|
+
}
|
|
191
|
+
const result = ES.RoundISODateTime(isoDateTime, roundingIncrement, smallestUnit, roundingMode);
|
|
192
|
+
|
|
193
|
+
return ES.CreateTemporalDateTime(result, GetSlot(this, CALENDAR));
|
|
194
|
+
}
|
|
195
|
+
equals(otherParam: Params['equals'][0]): Return['equals'] {
|
|
196
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
197
|
+
const other = ES.ToTemporalDateTime(otherParam);
|
|
198
|
+
if (ES.CompareISODateTime(GetSlot(this, ISO_DATE_TIME), GetSlot(other, ISO_DATE_TIME)) !== 0) return false;
|
|
199
|
+
return ES.CalendarEquals(GetSlot(this, CALENDAR), GetSlot(other, CALENDAR));
|
|
200
|
+
}
|
|
201
|
+
toString(options: Params['toString'][0] = undefined): string {
|
|
202
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
203
|
+
const resolvedOptions = ES.GetOptionsObject(options);
|
|
204
|
+
const showCalendar = ES.GetTemporalShowCalendarNameOption(resolvedOptions);
|
|
205
|
+
const digits = ES.GetTemporalFractionalSecondDigitsOption(resolvedOptions);
|
|
206
|
+
const roundingMode = ES.GetRoundingModeOption(resolvedOptions, 'trunc');
|
|
207
|
+
const smallestUnit = ES.GetTemporalUnitValuedOption(resolvedOptions, 'smallestUnit', 'time', undefined);
|
|
208
|
+
if (smallestUnit === 'hour') throw new RangeError('smallestUnit must be a time unit other than "hour"');
|
|
209
|
+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
|
|
210
|
+
const result = ES.RoundISODateTime(GetSlot(this, ISO_DATE_TIME), increment, unit, roundingMode);
|
|
211
|
+
ES.RejectDateTimeRange(result);
|
|
212
|
+
return ES.ISODateTimeToString(result, GetSlot(this, CALENDAR), precision, showCalendar);
|
|
213
|
+
}
|
|
214
|
+
toJSON(): Return['toJSON'] {
|
|
215
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
216
|
+
return ES.ISODateTimeToString(GetSlot(this, ISO_DATE_TIME), GetSlot(this, CALENDAR), 'auto');
|
|
217
|
+
}
|
|
218
|
+
toLocaleString(
|
|
219
|
+
locales: Params['toLocaleString'][0] = undefined,
|
|
220
|
+
options: Params['toLocaleString'][1] = undefined
|
|
221
|
+
): string {
|
|
222
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
223
|
+
return new DateTimeFormat(locales, options).format(this);
|
|
224
|
+
}
|
|
225
|
+
valueOf(): never {
|
|
226
|
+
ES.ValueOfThrows('PlainDateTime');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
toZonedDateTime(
|
|
230
|
+
temporalTimeZoneLike: Params['toZonedDateTime'][0],
|
|
231
|
+
options: Params['toZonedDateTime'][1] = undefined
|
|
232
|
+
): Return['toZonedDateTime'] {
|
|
233
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
234
|
+
const timeZone = ES.ToTemporalTimeZoneIdentifier(temporalTimeZoneLike);
|
|
235
|
+
const resolvedOptions = ES.GetOptionsObject(options);
|
|
236
|
+
const disambiguation = ES.GetTemporalDisambiguationOption(resolvedOptions);
|
|
237
|
+
const epochNs = ES.GetEpochNanosecondsFor(timeZone, GetSlot(this, ISO_DATE_TIME), disambiguation);
|
|
238
|
+
return ES.CreateTemporalZonedDateTime(epochNs, timeZone, GetSlot(this, CALENDAR));
|
|
239
|
+
}
|
|
240
|
+
toPlainDate(): Return['toPlainDate'] {
|
|
241
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
242
|
+
return ES.CreateTemporalDate(GetSlot(this, ISO_DATE_TIME).isoDate, GetSlot(this, CALENDAR));
|
|
243
|
+
}
|
|
244
|
+
toPlainTime(): Return['toPlainTime'] {
|
|
245
|
+
ES.CheckReceiver(this, ES.IsTemporalDateTime);
|
|
246
|
+
return ES.CreateTemporalTime(GetSlot(this, ISO_DATE_TIME).time);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
static from(item: Params['from'][0], options: Params['from'][1] = undefined): Return['from'] {
|
|
250
|
+
return ES.ToTemporalDateTime(item, options);
|
|
251
|
+
}
|
|
252
|
+
static compare(oneParam: Params['compare'][0], twoParam: Params['compare'][1]): Return['compare'] {
|
|
253
|
+
const one = ES.ToTemporalDateTime(oneParam);
|
|
254
|
+
const two = ES.ToTemporalDateTime(twoParam);
|
|
255
|
+
return ES.CompareISODateTime(GetSlot(one, ISO_DATE_TIME), GetSlot(two, ISO_DATE_TIME));
|
|
256
|
+
}
|
|
257
|
+
[Symbol.toStringTag]!: 'Temporal.PlainDateTime';
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
MakeIntrinsicClass(PlainDateTime, 'Temporal.PlainDateTime');
|
|
261
|
+
|
|
262
|
+
function getCalendarProperty<P extends keyof CalendarDateRecord>(
|
|
263
|
+
dt: Temporal.PlainDateTime,
|
|
264
|
+
prop: P
|
|
265
|
+
): CalendarDateRecord[P] {
|
|
266
|
+
ES.CheckReceiver(dt, ES.IsTemporalDateTime);
|
|
267
|
+
const isoDate = GetSlot(dt, ISO_DATE_TIME).isoDate;
|
|
268
|
+
return ES.calendarImplForObj(dt).isoToDate(isoDate, { [prop]: true })[prop];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function getTimeProperty(dt: Temporal.PlainDateTime, prop: Temporal.TimeUnit) {
|
|
272
|
+
ES.CheckReceiver(dt, ES.IsTemporalDateTime);
|
|
273
|
+
return GetSlot(dt, ISO_DATE_TIME).time[prop];
|
|
274
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as ES from './ecmascript';
|
|
2
|
+
import { MakeIntrinsicClass } from './intrinsicclass';
|
|
3
|
+
import { CALENDAR, GetSlot, ISO_DATE } from './slots';
|
|
4
|
+
import type { Temporal } from '..';
|
|
5
|
+
import { DateTimeFormat } from './intl';
|
|
6
|
+
import type { CalendarDateRecord, PlainMonthDayParams as Params, PlainMonthDayReturn as Return } from './internaltypes';
|
|
7
|
+
|
|
8
|
+
export class PlainMonthDay implements Temporal.PlainMonthDay {
|
|
9
|
+
constructor(
|
|
10
|
+
isoMonth: Params['constructor'][0],
|
|
11
|
+
isoDay: Params['constructor'][0],
|
|
12
|
+
calendarParam = 'iso8601',
|
|
13
|
+
referenceISOYear = 1972
|
|
14
|
+
) {
|
|
15
|
+
const month = ES.ToIntegerWithTruncation(isoMonth);
|
|
16
|
+
const day = ES.ToIntegerWithTruncation(isoDay);
|
|
17
|
+
const calendar = ES.CanonicalizeCalendar(calendarParam === undefined ? 'iso8601' : ES.RequireString(calendarParam));
|
|
18
|
+
const year = ES.ToIntegerWithTruncation(referenceISOYear);
|
|
19
|
+
|
|
20
|
+
ES.RejectISODate(year, month, day);
|
|
21
|
+
ES.CreateTemporalMonthDaySlots(this, { year, month, day }, calendar);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get monthCode(): Return['monthCode'] {
|
|
25
|
+
return getCalendarProperty(this, 'monthCode');
|
|
26
|
+
}
|
|
27
|
+
get day(): Return['day'] {
|
|
28
|
+
return getCalendarProperty(this, 'day');
|
|
29
|
+
}
|
|
30
|
+
get calendarId(): Return['calendarId'] {
|
|
31
|
+
ES.CheckReceiver(this, ES.IsTemporalMonthDay);
|
|
32
|
+
return GetSlot(this, CALENDAR);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
with(temporalMonthDayLike: Params['with'][0], options: Params['with'][1] = undefined): Return['with'] {
|
|
36
|
+
ES.CheckReceiver(this, ES.IsTemporalMonthDay);
|
|
37
|
+
if (!ES.IsObject(temporalMonthDayLike)) {
|
|
38
|
+
throw new TypeError('invalid argument');
|
|
39
|
+
}
|
|
40
|
+
ES.RejectTemporalLikeObject(temporalMonthDayLike);
|
|
41
|
+
|
|
42
|
+
const calendar = GetSlot(this, CALENDAR);
|
|
43
|
+
let fields = ES.ISODateToFields(calendar, GetSlot(this, ISO_DATE), 'month-day');
|
|
44
|
+
const partialMonthDay = ES.PrepareCalendarFields(
|
|
45
|
+
calendar,
|
|
46
|
+
temporalMonthDayLike,
|
|
47
|
+
['year', 'month', 'monthCode', 'day'],
|
|
48
|
+
[],
|
|
49
|
+
'partial'
|
|
50
|
+
);
|
|
51
|
+
fields = ES.CalendarMergeFields(calendar, fields, partialMonthDay);
|
|
52
|
+
|
|
53
|
+
const overflow = ES.GetTemporalOverflowOption(ES.GetOptionsObject(options));
|
|
54
|
+
const isoDate = ES.CalendarMonthDayFromFields(calendar, fields, overflow);
|
|
55
|
+
return ES.CreateTemporalMonthDay(isoDate, calendar);
|
|
56
|
+
}
|
|
57
|
+
equals(otherParam: Params['equals'][0]): Return['equals'] {
|
|
58
|
+
ES.CheckReceiver(this, ES.IsTemporalMonthDay);
|
|
59
|
+
const other = ES.ToTemporalMonthDay(otherParam);
|
|
60
|
+
if (ES.CompareISODate(GetSlot(this, ISO_DATE), GetSlot(other, ISO_DATE)) !== 0) return false;
|
|
61
|
+
return ES.CalendarEquals(GetSlot(this, CALENDAR), GetSlot(other, CALENDAR));
|
|
62
|
+
}
|
|
63
|
+
toString(options: Params['toString'][0] = undefined): string {
|
|
64
|
+
ES.CheckReceiver(this, ES.IsTemporalMonthDay);
|
|
65
|
+
const resolvedOptions = ES.GetOptionsObject(options);
|
|
66
|
+
const showCalendar = ES.GetTemporalShowCalendarNameOption(resolvedOptions);
|
|
67
|
+
return ES.TemporalMonthDayToString(this, showCalendar);
|
|
68
|
+
}
|
|
69
|
+
toJSON(): Return['toJSON'] {
|
|
70
|
+
ES.CheckReceiver(this, ES.IsTemporalMonthDay);
|
|
71
|
+
return ES.TemporalMonthDayToString(this);
|
|
72
|
+
}
|
|
73
|
+
toLocaleString(
|
|
74
|
+
locales: Params['toLocaleString'][0] = undefined,
|
|
75
|
+
options: Params['toLocaleString'][1] = undefined
|
|
76
|
+
): string {
|
|
77
|
+
ES.CheckReceiver(this, ES.IsTemporalMonthDay);
|
|
78
|
+
return new DateTimeFormat(locales, options).format(this);
|
|
79
|
+
}
|
|
80
|
+
valueOf(): never {
|
|
81
|
+
ES.ValueOfThrows('PlainMonthDay');
|
|
82
|
+
}
|
|
83
|
+
toPlainDate(item: Params['toPlainDate'][0]): Return['toPlainDate'] {
|
|
84
|
+
ES.CheckReceiver(this, ES.IsTemporalMonthDay);
|
|
85
|
+
if (!ES.IsObject(item)) throw new TypeError('argument should be an object');
|
|
86
|
+
const calendar = GetSlot(this, CALENDAR);
|
|
87
|
+
|
|
88
|
+
const fields = ES.ISODateToFields(calendar, GetSlot(this, ISO_DATE), 'month-day');
|
|
89
|
+
const inputFields = ES.PrepareCalendarFields(calendar, item, ['year'], [], []);
|
|
90
|
+
let mergedFields = ES.CalendarMergeFields(calendar, fields, inputFields);
|
|
91
|
+
const isoDate = ES.CalendarDateFromFields(calendar, mergedFields, 'constrain');
|
|
92
|
+
return ES.CreateTemporalDate(isoDate, calendar);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static from(item: Params['from'][0], options: Params['from'][1] = undefined): Return['from'] {
|
|
96
|
+
return ES.ToTemporalMonthDay(item, options);
|
|
97
|
+
}
|
|
98
|
+
[Symbol.toStringTag]!: 'Temporal.PlainMonthDay';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
MakeIntrinsicClass(PlainMonthDay, 'Temporal.PlainMonthDay');
|
|
102
|
+
|
|
103
|
+
function getCalendarProperty<P extends keyof CalendarDateRecord>(
|
|
104
|
+
md: Temporal.PlainMonthDay,
|
|
105
|
+
prop: P
|
|
106
|
+
): CalendarDateRecord[P] {
|
|
107
|
+
ES.CheckReceiver(md, ES.IsTemporalMonthDay);
|
|
108
|
+
const isoDate = GetSlot(md, ISO_DATE);
|
|
109
|
+
return ES.calendarImplForObj(md).isoToDate(isoDate, { [prop]: true })[prop];
|
|
110
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as ES from './ecmascript';
|
|
2
|
+
import { MakeIntrinsicClass } from './intrinsicclass';
|
|
3
|
+
|
|
4
|
+
import { GetSlot, TIME } from './slots';
|
|
5
|
+
import type { Temporal } from '..';
|
|
6
|
+
import { DateTimeFormat } from './intl';
|
|
7
|
+
import type { PlainTimeParams as Params, PlainTimeReturn as Return } from './internaltypes';
|
|
8
|
+
|
|
9
|
+
export class PlainTime implements Temporal.PlainTime {
|
|
10
|
+
constructor(isoHour = 0, isoMinute = 0, isoSecond = 0, isoMillisecond = 0, isoMicrosecond = 0, isoNanosecond = 0) {
|
|
11
|
+
const hour = isoHour === undefined ? 0 : ES.ToIntegerWithTruncation(isoHour);
|
|
12
|
+
const minute = isoMinute === undefined ? 0 : ES.ToIntegerWithTruncation(isoMinute);
|
|
13
|
+
const second = isoSecond === undefined ? 0 : ES.ToIntegerWithTruncation(isoSecond);
|
|
14
|
+
const millisecond = isoMillisecond === undefined ? 0 : ES.ToIntegerWithTruncation(isoMillisecond);
|
|
15
|
+
const microsecond = isoMicrosecond === undefined ? 0 : ES.ToIntegerWithTruncation(isoMicrosecond);
|
|
16
|
+
const nanosecond = isoNanosecond === undefined ? 0 : ES.ToIntegerWithTruncation(isoNanosecond);
|
|
17
|
+
|
|
18
|
+
ES.RejectTime(hour, minute, second, millisecond, microsecond, nanosecond);
|
|
19
|
+
const time = { hour, minute, second, millisecond, microsecond, nanosecond };
|
|
20
|
+
|
|
21
|
+
ES.CreateTemporalTimeSlots(this, time);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get hour(): Return['hour'] {
|
|
25
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
26
|
+
return GetSlot(this, TIME).hour;
|
|
27
|
+
}
|
|
28
|
+
get minute(): Return['minute'] {
|
|
29
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
30
|
+
return GetSlot(this, TIME).minute;
|
|
31
|
+
}
|
|
32
|
+
get second(): Return['second'] {
|
|
33
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
34
|
+
return GetSlot(this, TIME).second;
|
|
35
|
+
}
|
|
36
|
+
get millisecond(): Return['millisecond'] {
|
|
37
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
38
|
+
return GetSlot(this, TIME).millisecond;
|
|
39
|
+
}
|
|
40
|
+
get microsecond(): Return['microsecond'] {
|
|
41
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
42
|
+
return GetSlot(this, TIME).microsecond;
|
|
43
|
+
}
|
|
44
|
+
get nanosecond(): Return['nanosecond'] {
|
|
45
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
46
|
+
return GetSlot(this, TIME).nanosecond;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
with(temporalTimeLike: Params['with'][0], options: Params['with'][1] = undefined): Return['with'] {
|
|
50
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
51
|
+
if (!ES.IsObject(temporalTimeLike)) {
|
|
52
|
+
throw new TypeError('invalid argument');
|
|
53
|
+
}
|
|
54
|
+
ES.RejectTemporalLikeObject(temporalTimeLike);
|
|
55
|
+
|
|
56
|
+
const partialTime = ES.ToTemporalTimeRecord(temporalTimeLike, 'partial');
|
|
57
|
+
|
|
58
|
+
const fields = ES.ToTemporalTimeRecord(this);
|
|
59
|
+
let { hour, minute, second, millisecond, microsecond, nanosecond } = Object.assign(fields, partialTime);
|
|
60
|
+
const overflow = ES.GetTemporalOverflowOption(ES.GetOptionsObject(options));
|
|
61
|
+
({ hour, minute, second, millisecond, microsecond, nanosecond } = ES.RegulateTime(
|
|
62
|
+
hour,
|
|
63
|
+
minute,
|
|
64
|
+
second,
|
|
65
|
+
millisecond,
|
|
66
|
+
microsecond,
|
|
67
|
+
nanosecond,
|
|
68
|
+
overflow
|
|
69
|
+
));
|
|
70
|
+
return new PlainTime(hour, minute, second, millisecond, microsecond, nanosecond);
|
|
71
|
+
}
|
|
72
|
+
add(temporalDurationLike: Params['add'][0]): Return['add'] {
|
|
73
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
74
|
+
return ES.AddDurationToTime('add', this, temporalDurationLike);
|
|
75
|
+
}
|
|
76
|
+
subtract(temporalDurationLike: Params['subtract'][0]): Return['subtract'] {
|
|
77
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
78
|
+
return ES.AddDurationToTime('subtract', this, temporalDurationLike);
|
|
79
|
+
}
|
|
80
|
+
until(other: Params['until'][0], options: Params['until'][1] = undefined): Return['until'] {
|
|
81
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
82
|
+
return ES.DifferenceTemporalPlainTime('until', this, other, options);
|
|
83
|
+
}
|
|
84
|
+
since(other: Params['since'][0], options: Params['since'][1] = undefined): Return['since'] {
|
|
85
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
86
|
+
return ES.DifferenceTemporalPlainTime('since', this, other, options);
|
|
87
|
+
}
|
|
88
|
+
round(roundToParam: Params['round'][0]): Return['round'] {
|
|
89
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
90
|
+
if (roundToParam === undefined) throw new TypeError('options parameter is required');
|
|
91
|
+
const roundTo =
|
|
92
|
+
typeof roundToParam === 'string'
|
|
93
|
+
? (ES.CreateOnePropObject('smallestUnit', roundToParam) as Exclude<typeof roundToParam, string>)
|
|
94
|
+
: ES.GetOptionsObject(roundToParam);
|
|
95
|
+
const roundingIncrement = ES.GetTemporalRoundingIncrementOption(roundTo);
|
|
96
|
+
const roundingMode = ES.GetRoundingModeOption(roundTo, 'halfExpand');
|
|
97
|
+
const smallestUnit = ES.GetTemporalUnitValuedOption(roundTo, 'smallestUnit', 'time', ES.REQUIRED);
|
|
98
|
+
const MAX_INCREMENTS = {
|
|
99
|
+
hour: 24,
|
|
100
|
+
minute: 60,
|
|
101
|
+
second: 60,
|
|
102
|
+
millisecond: 1000,
|
|
103
|
+
microsecond: 1000,
|
|
104
|
+
nanosecond: 1000
|
|
105
|
+
};
|
|
106
|
+
ES.ValidateTemporalRoundingIncrement(roundingIncrement, MAX_INCREMENTS[smallestUnit], false);
|
|
107
|
+
|
|
108
|
+
const time = ES.RoundTime(GetSlot(this, TIME), roundingIncrement, smallestUnit, roundingMode);
|
|
109
|
+
return ES.CreateTemporalTime(time);
|
|
110
|
+
}
|
|
111
|
+
equals(otherParam: Params['equals'][0]): Return['equals'] {
|
|
112
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
113
|
+
const other = ES.ToTemporalTime(otherParam);
|
|
114
|
+
return ES.CompareTimeRecord(GetSlot(this, TIME), GetSlot(other, TIME)) === 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
toString(options: Params['toString'][0] = undefined): string {
|
|
118
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
119
|
+
const resolvedOptions = ES.GetOptionsObject(options);
|
|
120
|
+
const digits = ES.GetTemporalFractionalSecondDigitsOption(resolvedOptions);
|
|
121
|
+
const roundingMode = ES.GetRoundingModeOption(resolvedOptions, 'trunc');
|
|
122
|
+
const smallestUnit = ES.GetTemporalUnitValuedOption(resolvedOptions, 'smallestUnit', 'time', undefined);
|
|
123
|
+
if (smallestUnit === 'hour') throw new RangeError('smallestUnit must be a time unit other than "hour"');
|
|
124
|
+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
|
|
125
|
+
const time = ES.RoundTime(GetSlot(this, TIME), increment, unit, roundingMode);
|
|
126
|
+
return ES.TimeRecordToString(time, precision);
|
|
127
|
+
}
|
|
128
|
+
toJSON(): Return['toJSON'] {
|
|
129
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
130
|
+
return ES.TimeRecordToString(GetSlot(this, TIME), 'auto');
|
|
131
|
+
}
|
|
132
|
+
toLocaleString(
|
|
133
|
+
locales: Params['toLocaleString'][0] = undefined,
|
|
134
|
+
options: Params['toLocaleString'][1] = undefined
|
|
135
|
+
): string {
|
|
136
|
+
ES.CheckReceiver(this, ES.IsTemporalTime);
|
|
137
|
+
return new DateTimeFormat(locales, options).format(this);
|
|
138
|
+
}
|
|
139
|
+
valueOf(): never {
|
|
140
|
+
ES.ValueOfThrows('PlainTime');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
static from(item: Params['from'][0], options: Params['from'][1] = undefined): Return['from'] {
|
|
144
|
+
return ES.ToTemporalTime(item, options);
|
|
145
|
+
}
|
|
146
|
+
static compare(oneParam: Params['compare'][0], twoParam: Params['compare'][1]): Return['compare'] {
|
|
147
|
+
const one = ES.ToTemporalTime(oneParam);
|
|
148
|
+
const two = ES.ToTemporalTime(twoParam);
|
|
149
|
+
return ES.CompareTimeRecord(GetSlot(one, TIME), GetSlot(two, TIME));
|
|
150
|
+
}
|
|
151
|
+
[Symbol.toStringTag]!: 'Temporal.PlainTime';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
MakeIntrinsicClass(PlainTime, 'Temporal.PlainTime');
|