Skip to content

Commit

Permalink
Fixed import validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zequez committed Dec 1, 2024
1 parent d712376 commit f9a9538
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ui/src/store/validateGameSpace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ export default function validateGameSpace(inputData: any): GameSpace | null {
if (typeof data.isStewarded !== 'boolean') throw new Error(`'isStewarded' must be a boolean`);
if (typeof data.isArchived !== 'boolean') throw new Error(`'isArchived' must be a boolean`);
if (typeof data.isLibraryItem !== 'boolean') throw new Error(`'isLibraryItem' must be a boolean`);
if (!data.minMaxPlayers || !Array.isArray(data.minMaxPlayers) || data.minMaxPlayers.length !== 2)
throw new Error(`'minMaxPlayers' must be an array with two numbers: [minPlayers, maxPlayers]`);
if (!data.players || !Array.isArray(data.players)) throw new Error(`'players' must be an array`);
if (!data.playersSlots || !Array.isArray(data.playersSlots))
throw new Error(`'playersSlots' must be an array slot and pubKey properties`);
if (typeof data.lastChangeAt !== 'number') throw new Error(`'lastChangeAt' must be a number`);

return data as GameSpace;
Expand Down

0 comments on commit f9a9538

Please sign in to comment.