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;
}
