Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
26
node_modules/next/dist/esm/shared/lib/match-local-pattern.js
generated
vendored
Normal file
26
node_modules/next/dist/esm/shared/lib/match-local-pattern.js
generated
vendored
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue