File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ export const getDriverStandings = async (year: number = new Date().getFullYear()
16
16
const position : number = parseInt ( $ ( this ) . find ( "td:nth-child(1) > p:nth-child(1)" ) . text ( ) . trim ( ) ) ;
17
17
const driver_1 : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1) > a:nth-child(1) > span:nth-child(1)" ) . text ( ) . trim ( ) ;
18
18
const driver_2 : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1) > a:nth-child(1) > span:nth-child(2)" ) . text ( ) . trim ( ) ;
19
- const driver : string = driver_1 . concat ( " " , driver_2 . slice ( 0 , driver_2 . length - 3 ) ) . trim ( ) ;
19
+ const driver : string = driver_1
20
+ . concat ( " " , driver_2 . slice ( 0 , driver_2 . length - 3 ) )
21
+ . trim ( )
22
+ . replace ( / \u00a0 / g, " " ) ;
20
23
const nationality : string = $ ( this ) . find ( " td:nth-child(3) > p:nth-child(1)" ) . text ( ) ;
21
24
const team : string = $ ( this ) . find ( "td:nth-child(4) > p:nth-child(1) > a:nth-child(1)" ) . text ( ) ;
22
25
const points : number = parseInt ( $ ( this ) . find ( " td:nth-child(5) > p:nth-child(1) " ) . text ( ) ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,11 @@ export const getFastestLaps = async (year: number = new Date().getFullYear()): P
15
15
$ ( ".f1-table > tbody:nth-child(2) > tr" ) . each ( function ( ) {
16
16
const grandPrixAll : string = $ ( this ) . find ( "td:nth-child(1) > p:nth-child(1) > a" ) . contents ( ) . get ( ) [ 1 ] ;
17
17
const grandPrix : string = $ ( grandPrixAll ) . text ( ) ;
18
- const driverName : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1) > span:nth-child(1)" ) . text ( ) . trim ( ) ;
18
+ const driverName : string = $ ( this )
19
+ . find ( "td:nth-child(2) > p:nth-child(1) > span:nth-child(1)" )
20
+ . text ( )
21
+ . trim ( )
22
+ . replace ( / \u00a0 / g, " " ) ;
19
23
const car : string = $ ( this ) . find ( "td:nth-child(3) > p:nth-child(1)" ) . text ( ) . trim ( ) ;
20
24
const time : string = $ ( this ) . find ( "td:nth-child(4) > p:nth-child(1)" ) . text ( ) . trim ( ) ;
21
25
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export const getRaceResults = async (year: number = new Date().getFullYear()): P
16
16
const grandPrixAll : string = $ ( this ) . find ( "td:nth-child(1) > p:nth-child(1) > a:nth-child(1)" ) . contents ( ) . get ( ) [ 1 ] ;
17
17
const raceDate : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1)" ) . text ( ) . trim ( ) ;
18
18
const driverName : string = $ ( this ) . find ( "td:nth-child(3) > p:nth-child(1) > span:nth-child(1)" ) . text ( ) . trim ( ) ;
19
- const winner : string = driverName . slice ( 0 , driverName . length - 3 ) ;
19
+ const winner : string = driverName . slice ( 0 , driverName . length - 3 ) . replace ( / \u00a0 / g , " " ) ;
20
20
const car : string = $ ( this ) . find ( "td:nth-child(4) > p:nth-child(1)" ) . text ( ) . trim ( ) ;
21
21
const laps : number = parseInt ( $ ( this ) . find ( "td:nth-child(5) > p:nth-child(1)" ) . text ( ) . trim ( ) ) ;
22
22
const time : string = $ ( this ) . find ( "td:nth-child(6) > p:nth-child(1)" ) . text ( ) . trim ( ) ;
You can’t perform that action at this time.
0 commit comments