Something went wrong. Try again.
Find the cast and crew shared by two movies or TV shows crosscredit.haltcase.dev
Something went wrong. Try again.
1234567891011121314151617181920import { createHash } from "node:crypto";
// Tangled exposes the PR source branch, but no documented PR number environment variable.export function previewName(branch: string): string { if (!branch || branch === "main") { throw new Error("A preview needs a non-main source branch."); }
const slug = branch .toLowerCase() .replaceAll(/[^a-z0-9]+/g, "-") .slice(0, 24) .replace(/-+$/, "") || "branch";
const hash = createHash("sha256").update(branch).digest("hex").slice(0, 12);
return `pr-${slug}-${hash}`;}