This commit is contained in:
ghassan committed 2026-04-16 20:02:41 +03:00
1 parent eb0d79d503
commit b03c1d4619
12446 files changed
+1647557 -24

No files matched your search

+1
View File
@@ -0,0 +1 @@
export declare function resolvePageComponent<T>(path: string | string[], pages: Record<string, Promise<T> | (() => Promise<T>)>): Promise<T>;
+10
View File
@@ -0,0 +1,10 @@
export async function resolvePageComponent(path, pages) {
for (const p of (Array.isArray(path) ? path : [path])) {
const page = pages[p];
if (typeof page === 'undefined') {
continue;
}
return typeof page === 'function' ? page() : page;
}
throw new Error(`Page not found: ${path}`);
}