Review funkt

This commit is contained in:
2026-08-09 21:56:00 +00:00
parent f522ae9953
commit fe9dfa4519
11366 changed files with 2335077 additions and 97 deletions

View File

@@ -0,0 +1,26 @@
import { makeRe } from "next/dist/compiled/picomatch";
// Modifying this function should also modify writeImagesManifest()
export function matchLocalPattern(pattern, url) {
if (pattern.search !== undefined) {
if (pattern.search !== url.search) {
return false;
}
}
var _pattern_pathname;
if (!makeRe((_pattern_pathname = pattern.pathname) != null ? _pattern_pathname : "**", {
dot: true
}).test(url.pathname)) {
return false;
}
return true;
}
export function hasLocalMatch(localPatterns, urlPathAndQuery) {
if (!localPatterns) {
// if the user didn't define "localPatterns", we allow all local images
return true;
}
const url = new URL(urlPathAndQuery, "http://n");
return localPatterns.some((p)=>matchLocalPattern(p, url));
}
//# sourceMappingURL=match-local-pattern.js.map