import { defineParams } from "@sveltejs/kit/params"; import { parseRawCommit } from "#lib/api/rawCommit.ts"; // requiring the hash here means refs that are not hashes fall through to the // commit page const matchRawCommit = (param: string) => parseRawCommit(param) !== null; export const params = defineParams({ rawCommit: (param) => (matchRawCommit(param) ? param : undefined) });