8 lines
261 B
JavaScript
8 lines
261 B
JavaScript
export function makeIgnored(ignores) {
|
|
const rxAll = ["/\\.", "/-", ...ignores.filter((p) => p)].map((p) => new RegExp(p));
|
|
return function isIgnored(key) {
|
|
const path = "/" + key.replace(/:/g, "/");
|
|
return rxAll.some((rx) => rx.test(path));
|
|
};
|
|
}
|