Rocky_Mountain_Vending/.pnpm-store/v10/files/66/d77b2d6a0ae4f8615baed9116035721726b9749fd5f6d4aea673af48e53d550fffd9a19782f269ec3733da4d96bd296a64614de2be875b47c578345bae902e
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

23 lines
No EOL
1 KiB
Text

import { getRequestMeta } from './request-meta';
import { stringify as stringifyQs } from 'querystring';
// since initial query values are decoded by querystring.parse
// we need to re-encode them here but still allow passing through
// values from rewrites/redirects
export const stringifyQuery = (req, query)=>{
const initialQuery = getRequestMeta(req, 'initQuery') || {};
const initialQueryValues = Object.values(initialQuery);
return stringifyQs(query, undefined, undefined, {
encodeURIComponent (value) {
if (value in initialQuery || initialQueryValues.some((initialQueryVal)=>{
// `value` always refers to a query value, even if it's nested in an array
return Array.isArray(initialQueryVal) ? initialQueryVal.includes(value) : initialQueryVal === value;
})) {
// Encode keys and values from initial query
return encodeURIComponent(value);
}
return value;
}
});
};
//# sourceMappingURL=server-route-utils.js.map