Rocky_Mountain_Vending/.pnpm-store/v10/files/2b/6858a695851dd52ae62cb344fdb1a2b65ca6b64de70b659f65c62883fec0ff878ed75721e8d541316a75acf0e245c39fa262412e42b2e6badcd21ec51fae14
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

22 lines
No EOL
851 B
Text

/**
* The result of parsing a URL relative to a base URL.
*/ export function parseRelativeURL(url, base) {
const baseURL = typeof base === 'string' ? new URL(base) : base;
const relative = new URL(url, base);
// The URL is relative if the origin is the same as the base URL.
const isRelative = relative.origin === baseURL.origin;
return {
url: isRelative ? relative.toString().slice(baseURL.origin.length) : relative.toString(),
isRelative
};
}
/**
* Given a URL as a string and a base URL it will make the URL relative
* if the parsed protocol and host is the same as the one in the base
* URL. Otherwise it returns the same URL string.
*/ export function getRelativeURL(url, base) {
const relative = parseRelativeURL(url, base);
return relative.url;
}
//# sourceMappingURL=relativize-url.js.map