function MultiMatcher(resolve, globs) { this.ignores = [] this.keeps = [] var opts = { nocase: process.platform === "win32", nocomment: true, } globs.forEach(function (raw) { if (raw[0] === "!") { this.ignores.push(new minimatch.Minimatch( resolve(raw.slice(1)), opts)) } else { this.keeps.push(new minimatch.Minimatch(resolve(raw), opts)) } }, this) }
function makeMatcher(resolve, globs) { var glob, single if (Array.isArray(globs)) { if (globs.length !== 1) return new MultiMatcher(resolve, globs) glob = globs[0] } else { glob = globs } if (glob[0] === "!") { single = "!" + resolve(glob.slice(1)) } else { single = resolve(glob) } return new minimatch.Minimatch(single, { nocase: process.platform === "win32", nocomment: true, }) }