优化 util.match.js
parent
a6e3d57e35
commit
b0f6a9afaf
|
@ -6,6 +6,9 @@ function isMatched (url, regexp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function domainRegexply (target) {
|
function domainRegexply (target) {
|
||||||
|
if (target === '.*') {
|
||||||
|
return '^.*$'
|
||||||
|
}
|
||||||
return '^' + target.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$'
|
return '^' + target.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue