Comparing version 2.4.1 to 2.4.2
@@ -26,6 +26,8 @@ /* | ||
const stringToRegexp = ignored => { | ||
if (ignored.length === 0) { | ||
return; | ||
} | ||
const source = globToRegExp(ignored, { globstar: true, extended: true }) | ||
.source; | ||
const matchingStart = source.slice(0, source.length - 1) + "(?:$|\\/)"; | ||
return matchingStart; | ||
return source.slice(0, source.length - 1) + "(?:$|\\/)"; | ||
}; | ||
@@ -35,6 +37,14 @@ | ||
if (Array.isArray(ignored)) { | ||
const regexp = new RegExp(ignored.map(i => stringToRegexp(i)).join("|")); | ||
const stringRegexps = ignored.map(i => stringToRegexp(i)).filter(Boolean); | ||
if (stringRegexps.length === 0) { | ||
return () => false; | ||
} | ||
const regexp = new RegExp(stringRegexps.join("|")); | ||
return x => regexp.test(x.replace(/\\/g, "/")); | ||
} else if (typeof ignored === "string") { | ||
const regexp = new RegExp(stringToRegexp(ignored)); | ||
const stringRegexp = stringToRegexp(ignored); | ||
if (!stringRegexp) { | ||
return () => false; | ||
} | ||
const regexp = new RegExp(stringRegexp); | ||
return x => regexp.test(x.replace(/\\/g, "/")); | ||
@@ -41,0 +51,0 @@ } else if (ignored instanceof RegExp) { |
{ | ||
"name": "watchpack", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/watchpack.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
56385
1685
0