优化 util.match.js

pull/303/head
王良 2024-04-19 17:22:32 +08:00
parent a6e3d57e35
commit b0f6a9afaf
1 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,9 @@ function isMatched (url, regexp) {
}
function domainRegexply (target) {
if (target === '.*') {
return '^.*$'
}
return '^' + target.replace(/\./g, '\\.').replace(/\*/g, '.*') + '$'
}