Skip to content

Commit

Permalink
Merge pull request #19 from AuroPick/fix/undefined-options
Browse files Browse the repository at this point in the history
fixed a bug that caused an error if you do not pass options
  • Loading branch information
AuroPick authored Apr 21, 2023
2 parents 627d2d8 + 25632ea commit e77e2cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/epic-free-games/epic-free-games.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class EpicFreeGames {

private readonly epicGames: EpicGames

constructor(options: EpicFreeGamesOptions) {
constructor(options: EpicFreeGamesOptions = {}) {
this.epicFreeGamesUtil = new EpicFreeGamesUtil(options)
this.epicGames = new EpicGames()
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/epic-free-games/epic-free-games.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class EpicFreeGamesUtil {
locale: 'en-US'
}

constructor(options: EpicFreeGamesOptions) {
constructor(options: EpicFreeGamesOptions = {}) {
this.options = deepmerge(this.options, options)
}

Expand Down
6 changes: 3 additions & 3 deletions src/modules/epic-free-games/types/epic-free-games.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ export interface EpicFreeGamesOptions {
/**
* price and currency will change according to this value
*/
readonly country: Country
readonly country?: Country
/**
* include all offers like DLC's or hidden games
*/
readonly includeAll: boolean
readonly includeAll?: boolean
/**
* localization will change according to this value
*/
readonly locale: Locale
readonly locale?: Locale
}

export interface GetGames {
Expand Down

0 comments on commit e77e2cf

Please sign in to comment.