File tree Expand file tree Collapse file tree 6 files changed +6
-8
lines changed Expand file tree Collapse file tree 6 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
node_modules
2
2
dist
3
+ junk
Original file line number Diff line number Diff line change
1
+ src
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const getConstructorStandings = (year: number = new Date().getFullYear())
26
26
const team : string = $ ( this ) . find ( 'td:nth-child(3)' ) . text ( ) . trim ( )
27
27
const points : number = parseInt ( $ ( this ) . find ( 'td:nth-child(4)' ) . text ( ) . trim ( ) )
28
28
29
- if ( position !== NaN && team . length !== 0 && points !== NaN ) {
29
+ if ( ! Number . isNaN ( position ) && team . length !== 0 && ! Number . isNaN ( points ) ) {
30
30
const constructorStanding : constructorStanding = {
31
31
position,
32
32
team,
@@ -36,7 +36,6 @@ export const getConstructorStandings = (year: number = new Date().getFullYear())
36
36
}
37
37
} )
38
38
resolve ( constructorStandings )
39
- return Promise . all ( constructorStandings )
40
39
} )
41
40
. catch ( err => { reject ( err ) } )
42
41
} )
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export const getDriverData = (): Promise<drivers[]> => {
32
32
const nationalityImage : string | undefined = $ ( this ) . find ( '.container > .row.justify-content-between.align-items-center.listing-item--head > .col-xs-4.country-flag > picture:nth-child(1) > img:nth-child(2)' ) . attr ( 'data-src' )
33
33
const driverImage : string | undefined = $ ( this ) . find ( ' div:nth-child(4) > picture:nth-child(1) > img:nth-child(2)' ) . attr ( 'data-src' )
34
34
35
- if ( firstName . length !== 0 && secondName . length !== 0 && team . length !== 0 && rank !== NaN && points !== NaN ) {
35
+ if ( firstName . length !== 0 && secondName . length !== 0 && team . length !== 0 && ! Number . isNaN ( rank ) && ! Number . isNaN ( points ) ) {
36
36
const driver : drivers = {
37
37
name : firstName . concat ( " " , secondName ) ,
38
38
team,
@@ -45,7 +45,6 @@ export const getDriverData = (): Promise<drivers[]> => {
45
45
}
46
46
} )
47
47
resolve ( drivers )
48
- return Promise . all ( drivers )
49
48
} )
50
49
. catch ( err => { reject ( err ) } )
51
50
} )
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export const getDriverStandings = (year: number = new Date().getFullYear()): Pro
34
34
const team : string = $ ( this ) . find ( 'td:nth-child(5) > a.grey.semi-bold.uppercase.ArchiveLink' ) . text ( )
35
35
const points : number = parseInt ( $ ( this ) . find ( ' td:nth-child(6) ' ) . text ( ) )
36
36
37
- if ( position !== NaN && points !== NaN && driver . length !== 0 && nationality . length !== 0 && team . length !== 0 ) {
37
+ if ( ! Number . isNaN ( position ) && ! Number . isNaN ( points ) && driver . length !== 0 && nationality . length !== 0 && team . length !== 0 ) {
38
38
const driverStanding : driverStanding = {
39
39
position,
40
40
driver,
@@ -46,7 +46,6 @@ export const getDriverStandings = (year: number = new Date().getFullYear()): Pro
46
46
}
47
47
} )
48
48
resolve ( driverStandings )
49
- return Promise . all ( driverStandings )
50
49
} )
51
50
. catch ( err => { reject ( err ) } )
52
51
} )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const getTeamsData = (): Promise<teams[]> => {
39
39
const carLogo : string | undefined = $ ( this ) . find ( 'div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > picture:nth-child(1) > img:nth-child(2)' ) . attr ( 'data-src' )
40
40
const carImage : string | undefined = $ ( this ) . find ( 'div:nth-child(1) > div:nth-child(4) > picture:nth-child(1) > img:nth-child(5)' ) . attr ( 'data-src' )
41
41
42
- if ( name . length !== 0 && points !== NaN && rank !== NaN ) {
42
+ if ( name . length !== 0 && ! Number . isNaN ( points ) && ! Number . isNaN ( rank ) ) {
43
43
const team : teams = {
44
44
name,
45
45
drivers,
@@ -52,7 +52,6 @@ export const getTeamsData = (): Promise<teams[]> => {
52
52
}
53
53
} )
54
54
resolve ( teams )
55
- return Promise . all ( teams )
56
55
} )
57
56
. catch ( err => { reject ( err ) } )
58
57
} )
You can’t perform that action at this time.
0 commit comments