refactor(housekeeping): adopt ase route namespace
This commit is contained in:
1 parent
74756dfed2
commit
f72a2b6c74
32 files changed
+388
-264
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import type {
|
||||
CanonicalHousekeepingHref,
|
||||
HousekeepingSurface,
|
||||
} from "../contracts";
|
||||
|
||||
export function toHousekeepingHref(
|
||||
href: CanonicalHousekeepingHref,
|
||||
surface: HousekeepingSurface,
|
||||
): CanonicalHousekeepingHref | `/ase-next${string}` {
|
||||
if (href !== "/ase" && !href.startsWith("/ase/")) {
|
||||
throw new Error(`invalid canonical housekeeping href: ${href}`);
|
||||
}
|
||||
|
||||
return surface === "canonical" ? href : href.replace(/^\/ase/, "/ase-next");
|
||||
}
|
||||
Reference in new issue
Block a user