feat: refactoring project
This commit is contained in:
9
node_modules/webpack/lib/util/compileBooleanMatcher.js
generated
vendored
9
node_modules/webpack/lib/util/compileBooleanMatcher.js
generated
vendored
@@ -9,16 +9,14 @@
|
||||
* @param {string} str string
|
||||
* @returns {string} quoted meta
|
||||
*/
|
||||
const quoteMeta = str => {
|
||||
return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&");
|
||||
};
|
||||
const quoteMeta = str => str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&");
|
||||
|
||||
/**
|
||||
* @param {string} str string
|
||||
* @returns {string} string
|
||||
*/
|
||||
const toSimpleString = str => {
|
||||
if (`${+str}` === str) {
|
||||
if (`${Number(str)}` === str) {
|
||||
return str;
|
||||
}
|
||||
return JSON.stringify(str);
|
||||
@@ -52,9 +50,8 @@ const compileBooleanMatcherFromLists = (positiveItems, negativeItems) => {
|
||||
const negativeRegexp = itemsToRegexp(negativeItems);
|
||||
if (positiveRegexp.length <= negativeRegexp.length) {
|
||||
return value => `/^${positiveRegexp}$/.test(${value})`;
|
||||
} else {
|
||||
return value => `!/^${negativeRegexp}$/.test(${value})`;
|
||||
}
|
||||
return value => `!/^${negativeRegexp}$/.test(${value})`;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user