From 25632ea434c6fab2b478079921df5327412ea3c9 Mon Sep 17 00:00:00 2001 From: AuroPick Date: Fri, 21 Apr 2023 20:19:57 +0300 Subject: [PATCH] fixed a bug that caused an error if you do not pass options --- src/modules/epic-free-games/epic-free-games.module.ts | 2 +- src/modules/epic-free-games/epic-free-games.util.ts | 2 +- src/modules/epic-free-games/types/epic-free-games.type.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/epic-free-games/epic-free-games.module.ts b/src/modules/epic-free-games/epic-free-games.module.ts index dd73dbd..d97c3d8 100644 --- a/src/modules/epic-free-games/epic-free-games.module.ts +++ b/src/modules/epic-free-games/epic-free-games.module.ts @@ -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() } diff --git a/src/modules/epic-free-games/epic-free-games.util.ts b/src/modules/epic-free-games/epic-free-games.util.ts index f97df68..fd5cf94 100644 --- a/src/modules/epic-free-games/epic-free-games.util.ts +++ b/src/modules/epic-free-games/epic-free-games.util.ts @@ -22,7 +22,7 @@ export class EpicFreeGamesUtil { locale: 'en-US' } - constructor(options: EpicFreeGamesOptions) { + constructor(options: EpicFreeGamesOptions = {}) { this.options = deepmerge(this.options, options) } diff --git a/src/modules/epic-free-games/types/epic-free-games.type.ts b/src/modules/epic-free-games/types/epic-free-games.type.ts index 8428614..7efaddb 100644 --- a/src/modules/epic-free-games/types/epic-free-games.type.ts +++ b/src/modules/epic-free-games/types/epic-free-games.type.ts @@ -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 {