import { error } from '@sveltejs/kit'; import { getMatchDetail } from '$lib/server/fleet/match-history.js'; export function load({ params }: { params: { id: string } }) { if (!/^[1-9]\d*$/.test(params.id)) error(404, 'Match not found'); const match = getMatchDetail(Number(params.id)); if (!match) error(404, 'Match not found'); return { match }; }