Rocky_Mountain_Vending/.pnpm-store/v10/files/37/2c37e49bf875dd41d07c15b08044f8ac6de5b1ce98e2cdfa663f010f268f17532b33f0189f6a1079aa972118fc401342802f9329f793a0d048a88341075c53
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

37 lines
No EOL
778 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('/');
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "toRoute", {
enumerable: true,
get: function() {
return toRoute;
}
});
function toRoute(pathname) {
return pathname.replace(/(?:\/index)?\/?$/, '') || '/';
}
//# sourceMappingURL=to-route.js.map