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'
|
'use strict'
|
||||||
|
|
||||||
const nanomatch = require('nanomatch')
|
const micromatch = require('micromatch')
|
||||||
const template = require('./template')
|
const template = require('./template')
|
||||||
const moment = require('moment')
|
const moment = require('moment')
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ module.exports = function (locals) {
|
||||||
|
|
||||||
function isMatch (path, patterns) {
|
function isMatch (path, patterns) {
|
||||||
if (patterns && patterns.length) {
|
if (patterns && patterns.length) {
|
||||||
if (nanomatch.some(path, patterns, { matchBase: true })) return true
|
if (micromatch.isMatch(path, patterns, { matchBase: true })) return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue