Rocky_Mountain_Vending/.pnpm-store/v10/files/64/9f805956635a53aeb2a8861d6ec5fd3aa759ac6d4b13a7323a2c744c15da2a7a9c025eb67e719a5c6dd64278e1ceeb442bbb45f5dd96e408d943b525a1465a
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

28 lines
No EOL
1.1 KiB
Text

import escapePathDelimiters from '../../../shared/lib/router/utils/escape-path-delimiters';
import { DecodeError } from '../../../shared/lib/utils';
/**
* We only encode path delimiters for path segments from
* getStaticPaths so we need to attempt decoding the URL
* to match against and only escape the path delimiters
* this allows non-ascii values to be handled e.g.
* Japanese characters.
* */ function decodePathParams(pathname) {
// TODO: investigate adding this handling for non-SSG
// pages so non-ascii names also work there.
return pathname.split('/').map((seg)=>{
try {
seg = escapePathDelimiters(decodeURIComponent(seg), true);
} catch (_) {
// An improperly encoded URL was provided
throw Object.defineProperty(new DecodeError('Failed to decode path param(s).'), "__NEXT_ERROR_CODE", {
value: "E539",
enumerable: false,
configurable: true
});
}
return seg;
}).join('/');
}
export { decodePathParams };
//# sourceMappingURL=decode-path-params.js.map