Files
EpicNext-Cms/src/features/housekeeping/foundation/routing/href.ts
T

14 lines
383 B
TypeScript

import type { CanonicalHousekeepingHref } from "../contracts";
export const HOUSEKEEPING_ROOT = "/ase" as const;
export function toHousekeepingHref(
href: CanonicalHousekeepingHref,
): CanonicalHousekeepingHref {
if (href !== HOUSEKEEPING_ROOT && !href.startsWith(`${HOUSEKEEPING_ROOT}/`)) {
throw new Error(`invalid canonical housekeeping href: ${href}`);
}
return href;
}