Rocky_Mountain_Vending/.pnpm-store/v10/files/eb/33ad6299e4d3d620fa45754b59f14310a903c5292607abf89d3be69afcfdbfc9e7666152d4afcf63284997d3959b6ecf022981392de56276a4fe4a8cca7e79
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

39 lines
No EOL
1.1 KiB
Text

/**
* Encodes a parameter value using the provided encoder.
*
* @param value - The value to encode.
* @param encoder - The encoder to use.
* @returns The encoded value.
*/ export function encodeParam(value, encoder) {
let replaceValue;
if (Array.isArray(value)) {
replaceValue = value.map(encoder).join('/');
} else {
replaceValue = encoder(value);
}
return replaceValue;
}
/**
* Normalizes a pathname to a consistent format.
*
* @param pathname - The pathname to normalize.
* @returns The normalized pathname.
*/ export function normalizePathname(pathname) {
return pathname.replace(/\\/g, '/').replace(/(?!^)\/$/, '');
}
/**
* Creates a fallback route param.
*
* @param paramName - The name of the param.
* @param isParallelRouteParam - Whether this is a parallel route param or
* descends from a parallel route param.
* @returns The fallback route param.
*/ export function createFallbackRouteParam(paramName, paramType, isParallelRouteParam) {
return {
paramName,
paramType,
isParallelRouteParam
};
}
//# sourceMappingURL=utils.js.map