"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const match = require("minimatch");
const eval_1 = require("./eval");
function filter(files, filters, data, done) {
    if (!filters) {
        return done();
    }
    const fileNames = Object.keys(files);
    Object.keys(filters).forEach(glob => {
        fileNames.forEach(file => {
            if (match(file, glob, { dot: true })) {
                const condition = filters[glob];
                if (!(0, eval_1.default)(condition, data)) {
                    delete files[file];
                }
            }
        });
    });
    done();
}
exports.default = filter;
//# sourceMappingURL=filter.js.map