@@ -57,7 +57,7 @@ export class TimeDuration {
57
57
assert ( MathAbs ( this . subsec ) <= 999_999_999 , 'subseconds too big' ) ;
58
58
}
59
59
60
- static # validateNew( totalNs : JSBI , operation : string ) {
60
+ static validateNew ( totalNs : JSBI , operation : string ) {
61
61
if ( JSBI . greaterThan ( abs ( totalNs ) , TimeDuration . MAX ) ) {
62
62
throw new RangeErrorCtor ( `${ operation } of duration time units cannot exceed ${ TimeDuration . MAX } s` ) ;
63
63
}
@@ -84,20 +84,20 @@ export class TimeDuration {
84
84
) ,
85
85
JSBI . multiply ( JSBI . BigInt ( h ) , HOUR_NANOS )
86
86
) ;
87
- return TimeDuration . # validateNew( totalNs , 'total' ) ;
87
+ return TimeDuration . validateNew ( totalNs , 'total' ) ;
88
88
}
89
89
90
90
abs ( ) {
91
91
return new TimeDuration ( abs ( this . totalNs ) ) ;
92
92
}
93
93
94
94
add ( other : TimeDuration ) {
95
- return TimeDuration . # validateNew( JSBI . add ( this . totalNs , other . totalNs ) , 'sum' ) ;
95
+ return TimeDuration . validateNew ( JSBI . add ( this . totalNs , other . totalNs ) , 'sum' ) ;
96
96
}
97
97
98
98
add24HourDays ( days : number ) {
99
99
assert ( NumberIsInteger ( days ) , 'days must be an integer' ) ;
100
- return TimeDuration . # validateNew( JSBI . add ( this . totalNs , JSBI . multiply ( JSBI . BigInt ( days ) , DAY_NANOS_JSBI ) ) , 'sum' ) ;
100
+ return TimeDuration . validateNew ( JSBI . add ( this . totalNs , JSBI . multiply ( JSBI . BigInt ( days ) , DAY_NANOS_JSBI ) ) , 'sum' ) ;
101
101
}
102
102
103
103
addToEpochNs ( epochNs : JSBI | bigint ) {
@@ -153,14 +153,14 @@ export class TimeDuration {
153
153
? r1
154
154
: ApplyUnsignedRoundingMode ( r1 , r2 , cmp , isEven ( quotient ) , unsignedRoundingMode ) ;
155
155
const result = sign === 'positive' ? rounded : JSBI . unaryMinus ( rounded ) ;
156
- return TimeDuration . # validateNew( result , 'rounding' ) ;
156
+ return TimeDuration . validateNew ( result , 'rounding' ) ;
157
157
}
158
158
159
159
sign ( ) {
160
160
return this . cmp ( new TimeDuration ( ZERO ) ) ;
161
161
}
162
162
163
163
subtract ( other : TimeDuration ) {
164
- return TimeDuration . # validateNew( JSBI . subtract ( this . totalNs , other . totalNs ) , 'difference' ) ;
164
+ return TimeDuration . validateNew ( JSBI . subtract ( this . totalNs , other . totalNs ) , 'difference' ) ;
165
165
}
166
166
}
0 commit comments