/** * link-sink-allowlist (F47): a link that must stay on this site — one leading "/", not followed by "/" or "\\", * with no whitespace or backslash. Notification links are always site paths. */ export const SITE_PATH = /^\/(?![\/\\])[^\s\\]*$/; export function isSitePath(link: string | undefined | null): link is string { return typeof link === "string" && SITE_PATH.test(link); }