~james/core

core/web/src/params.ts -rw-r--r-- 386 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 14 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
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)
});