bugfix: 修复 `matchUtil.isMatched(...)` 方法的返回数据类型不正确的问题。
parent
28f9d85c34
commit
3a310eb8e1
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue