Rocky_Mountain_Vending/.pnpm-store/v10/files/bd/25f8ad8b57bf0ca98fb2e27a0df57398c5c7596c0ab7581caf5fffc2aaf33fbe12e955168901ccc9d7b8088dac772733ef50ef39a30203373ca290dd281be8
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
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>
2026-02-12 16:22:15 -07:00

27 lines
No EOL
582 B
Text

/**
* This transforms a URL pathname into a route. It removes any trailing slashes
* and the `/index` suffix.
*
* @param pathname - The URL path that needs to be optimized.
* @returns - The route
*
* @example
* // returns '/example'
* toRoute('/example/index/');
*
* @example
* // returns '/example'
* toRoute('/example/');
*
* @example
* // returns '/'
* toRoute('/index/');
*
* @example
* // returns '/'
* toRoute('/');
*/ export function toRoute(pathname) {
return pathname.replace(/(?:\/index)?\/?$/, '') || '/';
}
//# sourceMappingURL=to-route.js.map