Private: filters out files that should be ignored when copying assets.

* `file` {String} path to file.

Returns {Bool} true if it should be included, otherwise false.
328412
function filter(file) {
    if (files.indexOf(file) !== -1) return false;
    let include = true;
    regexs.forEach((regex) => {
      if (file.search(regex) !== -1) include = false;
    });
    return include;
  }
19102
function includedFiles(name){
    let includes=this.getIncludes(this.getFile(name));
    let ret=includes.map(include => {
        let ret = {
            absolute:path.join(name,"../",include.relPath),
            relative:include.relPath,
            match:include.match
        }
        return ret;
    })
    return ret;
}
1279171
function (a) {
            var self = this;
            if (a.file && a.line && !self.options.nocode) {
                a.foundAt = '../files/' + self.filterFileName(a.file) + '.html#l' + a.line;
                if (a.path) {
                    a.foundAt = a.path + '#l' + a.line;
                }
            }
            return a;
        }
1283942
def ignore_path?(action, options)
        options[:except].present? &&  options[:except].include?(action) and return true
        options[:only].present?   && !options[:only].include?(action)   and return true
        false
      end
819119
def include(self, path, is_file):
        
        return self.pattern_list.include(path) and self.file_filter.include(os.path.basename(path), is_file)
769574
function filenameInclude(filename, exclude, include) { // eslint-disable-line
  var output = true; // eslint-disable-line

  if (exclude) {
    if (globToRegExp(exclude, { extended: true }).test(filename)
    && !globToRegExp(include || '', { extended: true }).test(filename)) {
      output = false;
    }
  }

  return output;
}
112420
def should_ignore(self, filename):
        """"""
        _, ext = os.path.splitext(filename)
        return ext in self.ignored_file_extensions
1371591
function retrieveFilesToExclude(excludeFiles) {
  return globby.sync(excludeFiles).map(function(file) {
    return path.normalize(file);
  });
}
766165
function filterFiles( files ){
    var filtered = [],
        file,
        i;
    for( i = 0; i < files.length; i++ ){
        file = files[ i ];
        if( file.height &&
            file.width &&
            file.url ){
            //This is sufficient to serve as a level
            filtered.push({
                url: file.url,
                width: Number( file.width ),
                height: Number( file.height )
            });
        }
        else {
            $.console.error( 'Unsupported image format: %s', file.url ? file.url : '<no URL>' );
        }
    }

    return filtered.sort(function(a, b) {
        return a.height - b.height;
    });

}
178458
def excluded(self, filename, parent=None):
        
        if not self.options.exclude:
            return False
        basename = os.path.basename(filename)
        if filename_match(basename, self.options.exclude):
            return True
        if parent:
            filename = os.path.join(parent, filename)
        filename = os.path.abspath(filename)
        return filename_match(filename, self.options.exclude)
171409
function copyAssets({ assetsDir }) {
  if (_shouldCopyAssets(assetsDir)) {
    fs.copySync(distDir, assetsDir, {
      filter: src => !/inline/.test(src)
    });
  }
}
1117701
function (data) {
      var include = function (path, includeData) {
        var d = utils.shallowCopy({}, data);
        if (includeData) {
          d = utils.shallowCopy(d, includeData);
        }
        return includeFile(path, opts)(d);
      };
      return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]);
    }
983230
private static boolean exclude(String host, java.nio.file.Path path) {
        List<PathMatcher> exclusions = getExcludes(host);
        if (exclusions == null && host != null) {
            exclusions = getExcludes(null); // check global config
        }
        if (exclusions != null) {
            for (PathMatcher matcher : exclusions) {
                if (matcher.matches(path))
                    return true;
            }
        }
        return false;
    }
512194
function assetFile(filename, callback) {
      const data = {
        source: files[filename].source,
        destination: files[filename].destination || path.join(path.dirname(filename), '.')
      }
      delete files[filename]
      metalsmithAssets(data)(files, metalsmith, callback)
    }
260331
function addFile(filename) {
        if (ignoredPaths.contains(filename)) {
            return;
        }
        filename = fs.realpathSync(filename);
        if (added[filename]) {
            return;
        }
        files.push(filename);
        added[filename] = true;
    }
819508
def filter_files(files, path, path_without_extension, template_extensions)
      results = []

      files.each do |file|
        match = if file.start_with?(path)
                  path
                else
                  path_without_extension
                end

        processable_extensions = file[(match.length + 1)..-1].split(".")

        # All processable_extensions must be processable
        # by a template_extension
        next unless (processable_extensions - template_extensions).empty?

        if file.start_with?(path)
          # The whole path is found in the filename, not just
          # the path without the extension.
          # it must have priority over all else
          results.unshift(file)
        else
          results.push(file)
        end
      end
      results
    end
1118912
function filter_and_recursion_processing(file) {
    const filePath = path.join(...basePath, ...directoryPath, file);

    if (path.extname(file) === extension) {
      // partial file is found, passing through filter, process it later
      return file;
    } else if (fs.statSync(filePath).isDirectory()) {
      // directory found, do recursion and get processed partials back
      partials = partials.concat(
        getPartials({
          basePath,
          directoryPath: [...directoryPath, file],
          extension,
          encoding,
          getNameFunc
        })
      );
    }

    return false;
  }