astro-ghostcms/.pnpm-store/v3/files/e4/14e64d4898fde1b6d7f6a9c17d0...

14 lines
446 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
function matchRoute(pathname, manifest) {
const decodedPathname = decodeURI(pathname);
return manifest.routes.find((route) => {
return route.pattern.test(decodedPathname) || route.fallbackRoutes.some((fallbackRoute) => fallbackRoute.pattern.test(decodedPathname));
});
}
function matchAllRoutes(pathname, manifest) {
return manifest.routes.filter((route) => route.pattern.test(pathname));
}
export {
matchAllRoutes,
matchRoute
};