@@ -478,39 +478,6 @@ export function ParseTemporalInstant(isoString) {
478
478
return epochNs . subtract ( offsetNs ) ;
479
479
}
480
480
481
- export function RegulateISODateTime (
482
- year ,
483
- month ,
484
- day ,
485
- hour ,
486
- minute ,
487
- second ,
488
- millisecond ,
489
- microsecond ,
490
- nanosecond ,
491
- overflow
492
- ) {
493
- switch ( overflow ) {
494
- case 'reject' :
495
- RejectDateTime ( year , month , day , hour , minute , second , millisecond , microsecond , nanosecond ) ;
496
- break ;
497
- case 'constrain' :
498
- ( { year, month, day, hour, minute, second, millisecond, microsecond, nanosecond } = ConstrainISODateTime (
499
- year ,
500
- month ,
501
- day ,
502
- hour ,
503
- minute ,
504
- second ,
505
- millisecond ,
506
- microsecond ,
507
- nanosecond
508
- ) ) ;
509
- break ;
510
- }
511
- return { year, month, day, hour, minute, second, millisecond, microsecond, nanosecond } ;
512
- }
513
-
514
481
export function RegulateISODate ( year , month , day , overflow ) {
515
482
switch ( overflow ) {
516
483
case 'reject' :
@@ -657,10 +624,6 @@ export function ToLimitedTemporalDuration(item, disallowedProperties = []) {
657
624
return record ;
658
625
}
659
626
660
- export function ToTemporalDurationOverflow ( options ) {
661
- return GetOption ( options , 'overflow' , [ 'constrain' , 'balance' ] , 'constrain' ) ;
662
- }
663
-
664
627
export function ToTemporalOverflow ( options ) {
665
628
return GetOption ( options , 'overflow' , [ 'constrain' , 'reject' ] , 'constrain' ) ;
666
629
}
@@ -925,13 +888,6 @@ export function LargerOfTwoTemporalUnits(unit1, unit2) {
925
888
return unit1 ;
926
889
}
927
890
928
- export function CastIfDefined ( value , cast ) {
929
- if ( value !== undefined ) {
930
- return cast ( value ) ;
931
- }
932
- return value ;
933
- }
934
-
935
891
export function ToPartialRecord ( bag , fields , callerCast ?: ( value : unknown ) => unknown ) {
936
892
if ( Type ( bag ) !== 'Object' ) return false ;
937
893
let any ;
@@ -1773,12 +1729,6 @@ export function GetTemporalCalendarWithISODefault(item) {
1773
1729
return ToTemporalCalendar ( calendar ) ;
1774
1730
}
1775
1731
1776
- export function CalendarCompare ( one , two ) {
1777
- const cal1 = ToString ( one ) ;
1778
- const cal2 = ToString ( two ) ;
1779
- return cal1 < cal2 ? - 1 : cal1 > cal2 ? 1 : 0 ;
1780
- }
1781
-
1782
1732
export function CalendarEquals ( one , two ) {
1783
1733
if ( one === two ) return true ;
1784
1734
const cal1 = ToString ( one ) ;
@@ -3066,19 +3016,6 @@ export function ConstrainTime(hour, minute, second, millisecond, microsecond, na
3066
3016
return { hour, minute, second, millisecond, microsecond, nanosecond } ;
3067
3017
}
3068
3018
3069
- export function ConstrainISODateTime ( year , month , day , hour , minute , second , millisecond , microsecond , nanosecond ) {
3070
- ( { year, month, day } = ConstrainISODate ( year , month , day ) ) ;
3071
- ( { hour, minute, second, millisecond, microsecond, nanosecond } = ConstrainTime (
3072
- hour ,
3073
- minute ,
3074
- second ,
3075
- millisecond ,
3076
- microsecond ,
3077
- nanosecond
3078
- ) ) ;
3079
- return { year, month, day, hour, minute, second, millisecond, microsecond, nanosecond } ;
3080
- }
3081
-
3082
3019
export function RejectToRange ( value , min , max ) {
3083
3020
if ( value < min || value > max ) throw new RangeError ( `value out of range: ${ min } <= ${ value } <= ${ max } ` ) ;
3084
3021
}
@@ -3480,17 +3417,6 @@ export function AddTime(
3480
3417
return { deltaDays, hour, minute, second, millisecond, microsecond, nanosecond } ;
3481
3418
}
3482
3419
3483
- export function SubtractDate ( year , month , day , years , months , weeks , days , overflow ) {
3484
- days += 7 * weeks ;
3485
- day -= days ;
3486
- ( { year, month, day } = BalanceISODate ( year , month , day ) ) ;
3487
- month -= months ;
3488
- year -= years ;
3489
- ( { year, month } = BalanceISOYearMonth ( year , month ) ) ;
3490
- ( { year, month, day } = RegulateISODate ( year , month , day , overflow ) ) ;
3491
- return { year, month, day } ;
3492
- }
3493
-
3494
3420
export function AddDuration (
3495
3421
y1 ,
3496
3422
mon1 ,
@@ -4297,11 +4223,6 @@ export function CompareISODate(y1, m1, d1, y2, m2, d2) {
4297
4223
return 0 ;
4298
4224
}
4299
4225
4300
- export function AssertPositiveInteger ( num ) {
4301
- if ( ! NumberIsFinite ( num ) || MathAbs ( num ) !== num ) throw new RangeError ( `invalid positive integer: ${ num } ` ) ;
4302
- return num ;
4303
- }
4304
-
4305
4226
export function NonNegativeModulo ( x , y ) {
4306
4227
let result = x % y ;
4307
4228
if ( ObjectIs ( result , - 0 ) ) return 0 ;
0 commit comments