feat: refactoring project
This commit is contained in:
18
node_modules/watchpack/lib/watchpack.js
generated
vendored
18
node_modules/watchpack/lib/watchpack.js
generated
vendored
@@ -23,18 +23,28 @@ function addWatchersToSet(watchers, set) {
|
||||
}
|
||||
|
||||
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) + "(?:$|\\/)";
|
||||
};
|
||||
|
||||
const ignoredToFunction = ignored => {
|
||||
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, "/"));
|
||||
} else if (ignored instanceof RegExp) {
|
||||
return x => ignored.test(x.replace(/\\/g, "/"));
|
||||
|
||||
2
node_modules/watchpack/package.json
generated
vendored
2
node_modules/watchpack/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "watchpack",
|
||||
"version": "2.4.1",
|
||||
"version": "2.4.2",
|
||||
"description": "",
|
||||
"main": "./lib/watchpack.js",
|
||||
"directories": {
|
||||
|
||||
Reference in New Issue
Block a user