/**
 * File ignore filter. Excludes files which match ignore patterns.
 * @function lib.file.ignoreFilter
 * @param {string|string[]} pattern - Ignore glob pattern(s).
 * @return {function} - File ignore function.
 * @author Taka Okunishi
 *
 */
var file = require('./index'),
    matchesGlob = file.matchesGlob;
module.exports = function (pattern) {
    return function (filename) {
        if (!pattern) {
            return true;
        }
        pattern = [].concat(pattern);
        for (var i = 0; i < pattern.length; i++) {
            var hit = matchesGlob(filename, pattern[i]);
            if (hit) {
                return false;
            }
        }
        return true;
    };
};