11 lines
243 B
TypeScript
11 lines
243 B
TypeScript
export function redirect(url: string): never {
|
|
if (typeof window !== "undefined") {
|
|
window.location.assign(url);
|
|
}
|
|
throw new Error(`Redirect to ${url}`);
|
|
}
|
|
|
|
export function notFound(): never {
|
|
throw new Error("Route not found");
|
|
}
|