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>
19 lines
855 B
Text
19 lines
855 B
Text
import { extendedEncodeURIComponent } from "./extended-encode-uri-component";
|
|
export const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
|
|
if (input != null && input[memberName] !== undefined) {
|
|
const labelValue = labelValueProvider();
|
|
if (labelValue.length <= 0) {
|
|
throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
|
|
}
|
|
resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel
|
|
? labelValue
|
|
.split("/")
|
|
.map((segment) => extendedEncodeURIComponent(segment))
|
|
.join("/")
|
|
: extendedEncodeURIComponent(labelValue));
|
|
}
|
|
else {
|
|
throw new Error("No value provided for input HTTP label: " + memberName + ".");
|
|
}
|
|
return resolvedPath;
|
|
};
|