normalBase
A base path as tcm start --base takes it, made regular: /examples/notes (a leading slash, none trailing), or ""
for the site's root.
export function normalBase(base: string | undefined): string { const b = (base ?? "").trim().replace(/\/+$/, ""); if (!b) return ""; if (!/^[\w\-./~%]+$/.test(b) || b.split("/").includes("..")) throw new Error(`--base ${base}: a path, like /examples/notes`); return b.startsWith("/") ? b : `/${b}`; }