@@ -33,7 +33,7 @@ describe('time', () => {
3333 } ) ;
3434
3535 it ( 'handles time scale conversions and arithmetic' , ( ) => {
36- const taiExp = new Time ( 'TAI' , 2000n , 1 , 1 ) ;
36+ const taiExp = new Time ( 'TAI' , 2000 , 1 , 1 ) ;
3737 let taiAct = Time . fromISO ( '2000-01-01T00:00:00.000 TAI' ) ;
3838 assertTimeEqual ( taiExp , taiAct ) ;
3939
@@ -55,7 +55,7 @@ describe('time', () => {
5555 taiAct = taiExp . toScale ( 'UT1' , provider ) . toScale ( 'TAI' , provider ) ;
5656 assertTimeClose ( taiExp , taiAct ) ;
5757
58- const tai1 = new Time ( 'TAI' , 2000n , 1 , 1 , 0 , 0 , 0.5 ) ;
58+ const tai1 = new Time ( 'TAI' , 2000 , 1 , 1 , 0 , 0 , 0.5 ) ;
5959 assert . ok ( tai1 . julianDate ( 'jd' , 'seconds' ) > taiExp . julianDate ( 'jd' , 'seconds' ) ) ;
6060 const dt = new TimeDelta ( 0.5 ) ;
6161 assertTimeClose ( taiExp . add ( dt ) , tai1 ) ;
@@ -65,7 +65,7 @@ describe('time', () => {
6565 } ) ;
6666
6767 it ( 'parses and converts UTC' , ( ) => {
68- const utcExp = new UTC ( 2000n , 1 , 1 ) ;
68+ const utcExp = new UTC ( 2000 , 1 , 1 ) ;
6969
7070 let utcAct = UTC . fromISO ( '2000-01-01T00:00:00.000' ) ;
7171 assertTimeEqual ( utcExp , utcAct ) ;
@@ -101,7 +101,7 @@ describe('time', () => {
101101 assert . equal ( delta . toString ( ) , '1.5 seconds' ) ; // in case String calls toString
102102 assert . equal ( delta . inspect ? delta . inspect ( ) : delta . toString ( ) , '1.5 seconds' ) ;
103103
104- assert . equal ( delta . seconds ( ) , 1n ) ;
104+ assert . equal ( delta . seconds ( ) , 1 ) ;
105105 assert . equal ( delta . subsecond ( ) , 0.5 ) ;
106106
107107 assert . equal ( String ( delta . add ( delta ) ) , '3 seconds' ) ;
@@ -115,7 +115,7 @@ describe('time', () => {
115115 } ) ;
116116
117117 it ( 'constructs TimeDelta from various units' , ( ) => {
118- let td = TimeDelta . fromSeconds ( 123n ) ;
118+ let td = TimeDelta . fromSeconds ( 123 ) ;
119119 assert . equal ( td . toDecimalSeconds ( ) , 123 ) ;
120120
121121 td = TimeDelta . fromMinutes ( 2 ) ;
@@ -135,15 +135,15 @@ describe('time', () => {
135135 } ) ;
136136
137137 it ( 'stringifies Time correctly' , ( ) => {
138- const time = new Time ( 'TAI' , 2000n , 1 , 1 , 0 , 0 , 12.123456789123 ) ;
138+ const time = new Time ( 'TAI' , 2000 , 1 , 1 , 0 , 0 , 12.123456789123 ) ;
139139 assert . equal ( String ( time ) , '2000-01-01T00:00:12.123 TAI' ) ;
140140 assert . equal ( time . toString ( ) , '2000-01-01T00:00:12.123 TAI' ) ;
141141 } ) ;
142142
143143 it ( 'exposes Time accessors' , ( ) => {
144- const time = new Time ( 'TAI' , 2000n , 1 , 1 , 0 , 0 , 12.123456789123 ) ;
144+ const time = new Time ( 'TAI' , 2000 , 1 , 1 , 0 , 0 , 12.123456789123 ) ;
145145 assert . equal ( time . scale ( ) . abbreviation ( ) , 'TAI' ) ;
146- assert . equal ( time . year ( ) , 2000n ) ;
146+ assert . equal ( time . year ( ) , 2000 ) ;
147147 assert . equal ( time . month ( ) , 1 ) ;
148148 assert . equal ( time . day ( ) , 1 ) ;
149149 assert . equal ( time . hour ( ) , 0 ) ;
@@ -157,19 +157,19 @@ describe('time', () => {
157157 } ) ;
158158
159159 it ( 'rejects invalid dates and hours' , ( ) => {
160- assert . throws ( ( ) => new Time ( 'TAI' , 2000n , 13 , 1 ) , / i n v a l i d d a t e / ) ;
161- assert . throws ( ( ) => new Time ( 'TAI' , 2000n , 12 , 1 , 24 , 0 , 0 ) , / h o u r m u s t b e i n t h e r a n g e / ) ;
160+ assert . throws ( ( ) => new Time ( 'TAI' , 2000 , 13 , 1 ) , / i n v a l i d d a t e / ) ;
161+ assert . throws ( ( ) => new Time ( 'TAI' , 2000 , 12 , 1 , 24 , 0 , 0 ) , / h o u r m u s t b e i n t h e r a n g e / ) ;
162162 } ) ;
163163
164164 it ( 'disallows subtracting different time scales' , ( ) => {
165- const t1 = new Time ( 'TAI' , 2000n , 1 , 1 , 0 , 0 , 1.0 ) ;
166- const t0 = new Time ( 'TT' , 2000n , 1 , 1 , 0 , 0 , 1.0 ) ;
165+ const t1 = new Time ( 'TAI' , 2000 , 1 , 1 , 0 , 0 , 1.0 ) ;
166+ const t0 = new Time ( 'TT' , 2000 , 1 , 1 , 0 , 0 , 1.0 ) ;
167167 assert . throws ( ( ) => t1 . subtractTime ( t0 ) , / c a n n o t s u b t r a c t .* d i f f e r e n t t i m e s c a l e s / i) ;
168168 } ) ;
169169
170170 it ( 'disallows isclose on different time scales' , ( ) => {
171- const t0 = new Time ( 'TAI' , 2000n , 1 , 1 ) ;
172- const t1 = new Time ( 'TT' , 2000n , 1 , 1 ) ;
171+ const t0 = new Time ( 'TAI' , 2000 , 1 , 1 ) ;
172+ const t1 = new Time ( 'TT' , 2000 , 1 , 1 ) ;
173173 assert . throws ( ( ) => t0 . isClose ( t1 ) , / c a n n o t c o m p a r e .* d i f f e r e n t t i m e s c a l e s / i) ;
174174 } ) ;
175175
@@ -199,27 +199,27 @@ describe('time', () => {
199199 } ) ;
200200
201201 it ( 'rejects invalid epochs and units' , ( ) => {
202- const time = new Time ( 'TAI' , 2000n , 1 , 1 ) ;
202+ const time = new Time ( 'TAI' , 2000 , 1 , 1 ) ;
203203 assert . throws ( ( ) => time . julianDate ( 'unknown' , 'days' ) , / u n k n o w n e p o c h : u n k n o w n / ) ;
204204 assert . throws ( ( ) => time . julianDate ( 'jd' , 'unknown' ) , / u n k n o w n u n i t : u n k n o w n / ) ;
205205 } ) ;
206206
207207 it ( 'converts to/from two-part Julian dates' , ( ) => {
208- const expected = new Time ( 'TAI' , 2024n , 7 , 11 , 8 , 2 , 14.0 ) ;
208+ const expected = new Time ( 'TAI' , 2024 , 7 , 11 , 8 , 2 , 14.0 ) ;
209209 const [ jd1 , jd2 ] = expected . twoPartJulianDate ( ) ;
210210 const actual = Time . fromTwoPartJulianDate ( 'TAI' , jd1 , jd2 ) ;
211211 assertTimeClose ( expected , actual ) ;
212212 } ) ;
213213
214214 it ( 'converts from day-of-year' , ( ) => {
215- const expected = new Time ( 'TAI' , 2024n , 12 , 31 ) ;
216- const actual = Time . fromDayOfYear ( 'TAI' , 2024n , 366 ) ;
215+ const expected = new Time ( 'TAI' , 2024 , 12 , 31 ) ;
216+ const actual = Time . fromDayOfYear ( 'TAI' , 2024 , 366 ) ;
217217 assertTimeEqual ( actual , expected ) ;
218218 } ) ;
219219
220220 it ( 'exposes UTC accessors' , ( ) => {
221- const utc = new UTC ( 2000n , 1 , 1 , 12 , 13 , 14.123456789123 ) ;
222- assert . equal ( utc . year ( ) , 2000n ) ;
221+ const utc = new UTC ( 2000 , 1 , 1 , 12 , 13 , 14.123456789123 ) ;
222+ assert . equal ( utc . year ( ) , 2000 ) ;
223223 assert . equal ( utc . month ( ) , 1 ) ;
224224 assert . equal ( utc . day ( ) , 1 ) ;
225225 assert . equal ( utc . hour ( ) , 12 ) ;
@@ -235,15 +235,15 @@ describe('time', () => {
235235 } ) ;
236236
237237 it ( 'rejects invalid UTC inputs' , ( ) => {
238- assert . throws ( ( ) => new UTC ( 2000n , 0 , 1 ) , / i n v a l i d d a t e / ) ;
238+ assert . throws ( ( ) => new UTC ( 2000 , 0 , 1 ) , / i n v a l i d d a t e / ) ;
239239 assert . throws ( ( ) => UTC . fromISO ( '2000-01-01X00:00:00 UTC' ) , / i n v a l i d I S O / ) ;
240240 } ) ;
241241
242242 it ( 'handles EOP provider errors' , ( ) => {
243243 assert . throws ( ( ) => new EOPProvider ( 'invalid_path' ) , EopParserError ) ;
244244
245245 const provider = loadEOPProvider ( ) ;
246- const tai = new Time ( 'TAI' , 2100n , 1 , 1 ) ;
246+ const tai = new Time ( 'TAI' , 2100 , 1 , 1 ) ;
247247 assert . throws ( ( ) => tai . toScaleWithProvider ( 'UT1' , provider ) , EopProviderError ) ;
248248 } ) ;
249249} ) ;
0 commit comments