Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
No EOL
678 B
Text
21 lines
No EOL
678 B
Text
import { matchHas } from './prepare-destination';
|
|
export function getMiddlewareRouteMatcher(matchers) {
|
|
return (pathname, req, query)=>{
|
|
for (const matcher of matchers){
|
|
const routeMatch = new RegExp(matcher.regexp).exec(pathname);
|
|
if (!routeMatch) {
|
|
continue;
|
|
}
|
|
if (matcher.has || matcher.missing) {
|
|
const hasParams = matchHas(req, query, matcher.has, matcher.missing);
|
|
if (!hasParams) {
|
|
continue;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
}
|
|
|
|
//# sourceMappingURL=middleware-route-matcher.js.map |