Skip to content

Commit ce0ba77

Browse files
committed
default parameters added to functions and changed interface to types
1 parent 78f1a4d commit ce0ba77

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/scraper/constructors-standings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import cheerio from "cheerio"
33

44
import { dynamicLinks } from "../endpoints/endpoints"
55

6-
interface constructorStanding {
6+
type constructorStanding = {
77
position: number
88
team: string
99
points: number
1010
}
1111

12-
export const getConstructorStandings = (year: number): Promise<constructorStanding[]> => {
12+
export const getConstructorStandings = (year: number = new Date().getFullYear()): Promise<constructorStanding[]> => {
1313

1414
let constructorStandings: constructorStanding[] = []
1515

src/scraper/driver-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import cheerio from 'cheerio'
33

44
import { staticLinks } from "../endpoints/endpoints";
55

6-
interface drivers {
6+
type drivers = {
77
name: string
88
team: string
99
rank: number

src/scraper/driver-standings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import cheerio from "cheerio"
33

44
import { dynamicLinks } from "../endpoints/endpoints"
55

6-
interface driverStanding {
6+
type driverStanding = {
77
position: number
88
driver: string
99
nationality: string
1010
team: string
1111
points: number
1212
}
1313

14-
export const getDriverStandings = (year: number): Promise<driverStanding[]> => {
14+
export const getDriverStandings = (year: number = new Date().getFullYear()): Promise<driverStanding[]> => {
1515

1616
let driverStandings: driverStanding[] = []
1717

src/scraper/team-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import cheerio from "cheerio"
33

44
import { staticLinks } from "../endpoints/endpoints";
55

6-
interface teams {
6+
type teams = {
77
name: string
88
drivers: string[]
99
points: number

0 commit comments

Comments
 (0)