ispt4.0_laravel/node_modules/laravel-vite-plugin/inertia-helpers/index.js
2024-04-17 11:58:01 +01:00

8 lines
242 B
JavaScript

export async function resolvePageComponent(path, pages) {
const page = pages[path];
if (typeof page === 'undefined') {
throw new Error(`Page not found: ${path}`);
}
return typeof page === 'function' ? page() : page;
}