2025-09-05 14:59:21 +08:00

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));
};
}