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>
22 lines
No EOL
709 B
Text
22 lines
No EOL
709 B
Text
import { RSC_SEGMENT_SUFFIX, RSC_SEGMENTS_DIR_SUFFIX } from '../../../lib/constants';
|
|
const PATTERN = new RegExp(`^(/.*)${RSC_SEGMENTS_DIR_SUFFIX}(/.*)${RSC_SEGMENT_SUFFIX}$`);
|
|
export class SegmentPrefixRSCPathnameNormalizer {
|
|
match(pathname) {
|
|
return PATTERN.test(pathname);
|
|
}
|
|
extract(pathname) {
|
|
const match = pathname.match(PATTERN);
|
|
if (!match) return null;
|
|
return {
|
|
originalPathname: match[1],
|
|
segmentPath: match[2]
|
|
};
|
|
}
|
|
normalize(pathname) {
|
|
const match = this.extract(pathname);
|
|
if (!match) return pathname;
|
|
return match.originalPathname;
|
|
}
|
|
}
|
|
|
|
//# sourceMappingURL=segment-prefix-rsc.js.map |