mirror of https://gitlab.com/curben/blog
refactor: replace nanomatch with micromatch
https://github.com/hexojs/hexo/pull/3538
This commit is contained in:
parent
03001eaabf
commit
007ece5fae
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const nanomatch = require('nanomatch')
|
||||
const micromatch = require('micromatch')
|
||||
const template = require('./template')
|
||||
const moment = require('moment')
|
||||
|
||||
|
@ -59,7 +59,7 @@ module.exports = function (locals) {
|
|||
|
||||
function isMatch (path, patterns) {
|
||||
if (patterns && patterns.length) {
|
||||
if (nanomatch.some(path, patterns, { matchBase: true })) return true
|
||||
if (micromatch.isMatch(path, patterns, { matchBase: true })) return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue