@@ -146,7 +146,10 @@ const modulus = (a: number, b: number): number => {
146146}
147147
148148const astro = ( time : Date ) : AstroData => {
149- const result : Partial < AstroData > = { }
149+ // This gets cast to `AstroData` later, but we build it up step by step here
150+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
151+ const result : any = { }
152+
150153 const polynomials : Record < string , number [ ] > = {
151154 s : coefficients . lunarLongitude ,
152155 h : coefficients . solarLongitude ,
@@ -161,12 +164,12 @@ const astro = (time: Date): AstroData => {
161164 // Polynomials are in T, that is Julian Centuries; we want our speeds to be
162165 // in the more convenient unit of degrees per hour.
163166 const dTdHour = 1 / ( 24 * 365.25 * 100 )
164- Object . keys ( polynomials ) . forEach ( ( name ) => {
165- ; ( result as any ) [ name ] = {
167+ for ( const name in polynomials ) {
168+ result [ name ] = {
166169 value : modulus ( polynomial ( polynomials [ name ] , T ( time ) ) , 360.0 ) ,
167170 speed : derivativePolynomial ( polynomials [ name ] , T ( time ) ) * dTdHour
168171 }
169- } )
172+ }
170173
171174 // Some other parameters defined by Schureman which are dependent on the
172175 // parameters N, i, omega for use in node factor calculations. We don't need
@@ -183,13 +186,9 @@ const astro = (time: Date): AstroData => {
183186 }
184187 Object . keys ( functions ) . forEach ( ( name ) => {
185188 const functionCall = functions [ name ]
186- ; ( result as any ) [ name ] = {
189+ result [ name ] = {
187190 value : modulus (
188- functionCall (
189- ( result as any ) . N . value ,
190- ( result as any ) . i . value ,
191- ( result as any ) . omega . value
192- ) ,
191+ functionCall ( result . N . value , result . i . value , result . omega . value ) ,
193192 360.0
194193 ) ,
195194 speed : null
@@ -204,16 +203,16 @@ const astro = (time: Date): AstroData => {
204203 speed : 15.0
205204 }
206205
207- ; ( result as any ) [ 'T+h-s' ] = {
208- value : hour . value + ( result as any ) . h . value - ( result as any ) . s . value ,
209- speed : hour . speed + ( result as any ) . h . speed - ( result as any ) . s . speed
206+ result [ 'T+h-s' ] = {
207+ value : hour . value + result . h . value - result . s . value ,
208+ speed : hour . speed + result . h . speed - result . s . speed
210209 }
211210
212211 // It is convenient to calculate Schureman's P here since several node
213212 // factors need it, although it could be argued that these
214213 // (along with I, xi, nu etc) belong somewhere else.
215- ; ( result as any ) . P = {
216- value : ( result as any ) . p . value - ( ( result as any ) . xi . value % 360.0 ) ,
214+ result . P = {
215+ value : result . p . value - ( result . xi . value % 360.0 ) ,
217216 speed : null
218217 }
219218
0 commit comments