Remove unecessary if statement
This commit is contained in:
parent
698e2a5487
commit
78b9d23d09
3 changed files with 15 additions and 19 deletions
18
lib/actions-util.js
generated
18
lib/actions-util.js
generated
|
|
@ -109,16 +109,14 @@ function patternToRegExp(value) {
|
|||
return new RegExp(`^${value
|
||||
.split(GLOB_PATTERN)
|
||||
.reduce(function (arr, cur) {
|
||||
if (cur) {
|
||||
if (cur === "**") {
|
||||
arr.push(".*?");
|
||||
}
|
||||
else if (cur === "*") {
|
||||
arr.push("[^/]*?");
|
||||
}
|
||||
else {
|
||||
arr.push(escapeRegExp(cur));
|
||||
}
|
||||
if (cur === "**") {
|
||||
arr.push(".*?");
|
||||
}
|
||||
else if (cur === "*") {
|
||||
arr.push("[^/]*?");
|
||||
}
|
||||
else if (cur) {
|
||||
arr.push(escapeRegExp(cur));
|
||||
}
|
||||
return arr;
|
||||
}, [])
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -145,14 +145,12 @@ function patternToRegExp(value) {
|
|||
`^${value
|
||||
.split(GLOB_PATTERN)
|
||||
.reduce(function (arr, cur) {
|
||||
if (cur) {
|
||||
if (cur === "**") {
|
||||
arr.push(".*?");
|
||||
} else if (cur === "*") {
|
||||
arr.push("[^/]*?");
|
||||
} else {
|
||||
arr.push(escapeRegExp(cur));
|
||||
}
|
||||
if (cur === "**") {
|
||||
arr.push(".*?");
|
||||
} else if (cur === "*") {
|
||||
arr.push("[^/]*?");
|
||||
} else if (cur) {
|
||||
arr.push(escapeRegExp(cur));
|
||||
}
|
||||
return arr;
|
||||
}, [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue