13 lines
287 B
TypeScript
13 lines
287 B
TypeScript
import { error } from '@sveltejs/kit';
|
|
import games from '$lib/games/games';
|
|
|
|
export function load({ params }) {
|
|
const index = parseInt(params.game);
|
|
if (isNaN(index)) {
|
|
error(404);
|
|
}
|
|
const game = games[index];
|
|
if (game === undefined) error(404);
|
|
else return game;
|
|
}
|