bugfix: 修复 `matchUtil.isMatched(...)` 方法的返回数据类型不正确的问题。

pull/375/head
王良 2024-10-09 15:45:17 +08:00
parent 28f9d85c34
commit 3a310eb8e1
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ const log = require('./util.log')
function isMatched (url, regexp) {
if (regexp === '.*' || regexp === '*' || regexp === 'true' || regexp === true) {
return url
return [url]
}
try {
@ -14,7 +14,7 @@ function isMatched (url, regexp) {
return url.match(urlRegexp)
} catch (e) {
log.error('匹配串有问题:', regexp)
return false
return null
}
}