docs: function matches_filter(filters, logicalPath, filename) {
    if (filters.length === 0) {
      return true;
    }
  
    return _.some(filters, function (filter) {
      if (_.isRegExp(filter)) {
        return filter.test(logicalPath);
      }
  
      if (_.isFunction(filter)) {
        return filter(logicalPath, filename);
      }
  
      // prepare string to become RegExp.
      // mimics shell's globbing
      filter = filter.toString().replace(/\*\*|\*|\?|\\.|\./g, function (m) {
        if (m[0] === '*') {
          return m === '**' ? '.+?' : '[^/]+?';
        }
  
        if (m[0] === '?') {
          return '[^/]?';
        }
  
        if (m[0] === '.') {
          return '\\.';
        }
  
        // handle `\\.` part
        return m;
      });
  
      // prepare RegExp
      filter = new RegExp('^' + filter + '$');
      return filter.test(logicalPath);
    });
  }