@@ -45,12 +45,12 @@ const regexes = {
4545const formatEntry = ( entry : OfflineDatabaseSchema ) : Relation => {
4646 const relation : Relation = { }
4747
48- entry . sources . forEach ( ( src ) => {
48+ for ( const src of entry . sources ) {
4949 const anilistMatch = regexes . anilist . exec ( src )
5050 if ( anilistMatch ) {
5151 const id = Number ( anilistMatch [ 1 ] )
5252
53- if ( isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
53+ if ( Number . isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
5454
5555 relation . anilist = id
5656 }
@@ -59,7 +59,7 @@ const formatEntry = (entry: OfflineDatabaseSchema): Relation => {
5959 if ( anidbMatch ) {
6060 const id = Number ( anidbMatch [ 1 ] )
6161
62- if ( isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
62+ if ( Number . isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
6363
6464 relation . anidb = id
6565 }
@@ -68,7 +68,7 @@ const formatEntry = (entry: OfflineDatabaseSchema): Relation => {
6868 if ( malMatch ) {
6969 const id = Number ( malMatch [ 1 ] )
7070
71- if ( isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
71+ if ( Number . isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
7272
7373 relation . myanimelist = id
7474 }
@@ -77,11 +77,11 @@ const formatEntry = (entry: OfflineDatabaseSchema): Relation => {
7777 if ( kitsuMatch ) {
7878 const id = Number ( kitsuMatch [ 1 ] )
7979
80- if ( isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
80+ if ( Number . isNaN ( id ) ) throw new Error ( `${ src } 's ID is not a number!!` )
8181
8282 relation . kitsu = id
8383 }
84- } )
84+ }
8585
8686 return relation
8787}
@@ -113,8 +113,8 @@ export const updateRelations = async () => {
113113 knex . batchInsert ( 'relations' , formattedEntries , 100 ) . transacting ( trx ) ,
114114 ) ,
115115 )
116- } catch ( e ) {
117- throw new Error ( e )
116+ } catch ( error ) {
117+ throw new Error ( error )
118118 }
119119 Logger . info ( 'Updated database.' )
120120
0 commit comments