gulp-armapbo
Version:
The plugin for Gulp which allows to pack ArmA pbo files from sources.
31 lines (29 loc) • 875 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const minimatch_1 = require("minimatch");
class PatternMatcher {
static create(patterns) {
const matchers = patterns.map(p => new minimatch_1.Minimatch(p));
return new PatternMatcher(matchers);
}
constructor(matchers) {
this._matchers = matchers;
}
match(fileName) {
let result = false;
this._matchers.forEach(m => {
if (result === m.negate) {
const match = m.match(fileName);
if (match && !m.negate) {
result = true;
}
if (!match && m.negate) {
result = false;
}
}
});
return result;
}
}
exports.PatternMatcher = PatternMatcher;
//# sourceMappingURL=patternMatcher.js.map