Rocky_Mountain_Vending/.pnpm-store/v10/files/5d/fa1851c8a2ba42c6573262bf0a9e7fbd4975b1f916fa5d277c5b2ed967f1e40b918ad9529e29410bc8aa61c540f2c50250eb6d137a80e56c7a20b0685d46fd
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

42 lines
No EOL
1.4 KiB
Text

import { makeRe } from 'next/dist/compiled/picomatch';
// Modifying this function should also modify writeImagesManifest()
export function matchRemotePattern(pattern, url) {
if (pattern.protocol !== undefined) {
if (pattern.protocol.replace(/:$/, '') !== url.protocol.replace(/:$/, '')) {
return false;
}
}
if (pattern.port !== undefined) {
if (pattern.port !== url.port) {
return false;
}
}
if (pattern.hostname === undefined) {
throw Object.defineProperty(new Error(`Pattern should define hostname but found\n${JSON.stringify(pattern)}`), "__NEXT_ERROR_CODE", {
value: "E410",
enumerable: false,
configurable: true
});
} else {
if (!makeRe(pattern.hostname).test(url.hostname)) {
return false;
}
}
if (pattern.search !== undefined) {
if (pattern.search !== url.search) {
return false;
}
}
// Should be the same as writeImagesManifest()
if (!makeRe(pattern.pathname ?? '**', {
dot: true
}).test(url.pathname)) {
return false;
}
return true;
}
export function hasRemoteMatch(domains, remotePatterns, url) {
return domains.some((domain)=>url.hostname === domain) || remotePatterns.some((p)=>matchRemotePattern(p, url));
}
//# sourceMappingURL=match-remote-pattern.js.map