Skip to content

Commit

Permalink
fix(db): Make listGames options optional (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored Mar 27, 2020
1 parent f3c62a3 commit 618618e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/server/db/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export abstract class Async {
/**
* Return all games.
*/
abstract listGames(opts: ListGamesOpts): Promise<string[]>;
abstract listGames(opts?: ListGamesOpts): Promise<string[]>;
}

export abstract class Sync {
Expand Down Expand Up @@ -161,5 +161,5 @@ export abstract class Sync {
/**
* Return all games.
*/
abstract listGames(opts: ListGamesOpts): string[];
abstract listGames(opts?: ListGamesOpts): string[];
}
4 changes: 2 additions & 2 deletions src/server/db/inmemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export class InMemory extends StorageAPI.Sync {
/**
* Return all keys.
*/
listGames(opts: StorageAPI.ListGamesOpts): string[] {
if (opts.gameName !== undefined) {
listGames(opts?: StorageAPI.ListGamesOpts): string[] {
if (opts && opts.gameName !== undefined) {
let gameIDs = [];
this.metadata.forEach((metadata, gameID) => {
if (metadata.gameName === opts.gameName) {
Expand Down

0 comments on commit 618618e

Please sign in to comment.