忽略指定的 path

@param  {Array} ignores   忽略规则列表
@param  {string} pathName 需要判断的 path
@return {boolean}          判断的结果
1286
function ignoreMatch(ignores, pathName) {
    let result = false;

    ignores.forEach(ignore => {
        if (minimatch(pathName, ignore)) {
            result = true;
        }
    });

    return result;
}
165596
def find(name, version = nil)
      name     = Pathname.new(name)
      stem     = name.basename
      version  = version && version.strip != '' ? version.strip : nil
      ext      = '.js'
      possible_paths = if version
        [
          /#{stem}-#{version}\/#{name}#{ext}$/,
         /#{name}-#{version}#{ext}$/
        ]
      else
        [
          /#{name}#{ext}/,
          /#{name}-[\d\w\.\-]+#{ext}/
        ]
      end
      final = false
      each_file_in_index(ext) do |filename|
        possible_paths.each do |p|
          if File.file?(filename) && p.match(filename)
            final = Pathname.new(filename).expand_path
            block_given? ? yield(final) : break
          end
        end
        break if final && !block_given?
      end
      final
    end
531959
private Map<String, String[]> findAllFiles(Collection<String> pathsToScan, String[] includesPattern, Collection<String> excludes) {
        Map<String, String[]> pathToIncludedFilesMap = new HashMap<>();
        pathsToScan.stream().forEach(scanFolder -> {
            String[] includedFiles = getDirectoryContent(new File(scanFolder).getPath(), includesPattern,
                    excludes.toArray(new String[excludes.size()]), false, false);
            pathToIncludedFilesMap.put(new File(scanFolder).getAbsolutePath(), includedFiles);
        });
        return pathToIncludedFilesMap;
    }
1140077
function (item) {
          const resolvedPath = path.resolve(item);
          const ignore = (resolvedPath.indexOf(srcPath) === -1);
          return ignore;
        }
798765
function getlist(fpath, prefix) {
    try {
      folders = fs.readdirSync(fpath);
    } catch (e) {
      return;
    }

    prefix = prefix || '';

    _.each(folders, function(f) {
      var p;
      npath = path.join(fpath, f);

      // 如果当前f是文件夹，则添加代表文件夹的分隔符，否则判断文件名是否匹配正则，不匹配则不扔进数组
      if (fs.existsSync(npath) && fs.lstatSync(npath).isDirectory()) {

        f += '/';

        // 如果要获取所有文件则递归获取下一层目录的文件
        if (hasGrep) getlist(npath, prefix + f);

      } else if (f.match(re)) {

        p = re ? RegExp.$1 : f;

      } else {
        return;
      }

      // 如果grepKey为string则匹配文件/文件夹名
      if (hasGrep && f.indexOf(grepKey) === -1) return;

      urlList.push({
        name: f,
        path: prefix + (p || f)
      });
    });
  }
972357
function replacePath (path, keys) {
  var index = 0;

  function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
    if (escaped) {
      return escaped;
    }

    if (escape) {
      return '\\' + escape;
    }

    var repeat   = suffix === '+' || suffix === '*';
    var optional = suffix === '?' || suffix === '*';

    keys.push({
      name:      key || index++,
      delimiter: prefix || '/',
      optional:  optional,
      repeat:    repeat
    });

    prefix = prefix ? ('\\' + prefix) : '';
    capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?');

    if (repeat) {
      capture = capture + '(?:' + prefix + capture + ')*';
    }

    if (optional) {
      return '(?:' + prefix + '(' + capture + '))?';
    }

    // Basic parameter support.
    return prefix + '(' + capture + ')';
  }

  return path.replace(PATH_REGEXP, replace);
}
550521
function resolvePathname(to) {
  var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

  var toParts = to && to.split('/') || [];
  var fromParts = from && from.split('/') || [];

  var isToAbs = to && isAbsolute(to);
  var isFromAbs = from && isAbsolute(from);
  var mustEndAbs = isToAbs || isFromAbs;

  if (to && isAbsolute(to)) {
    // to is absolute
    fromParts = toParts;
  } else if (toParts.length) {
    // to is relative, drop the filename
    fromParts.pop();
    fromParts = fromParts.concat(toParts);
  }

  if (!fromParts.length) { return '/'; }

  var hasTrailingSlash = void 0;
  if (fromParts.length) {
    var last = fromParts[fromParts.length - 1];
    hasTrailingSlash = last === '.' || last === '..' || last === '';
  } else {
    hasTrailingSlash = false;
  }

  var up = 0;
  for (var i = fromParts.length; i >= 0; i--) {
    var part = fromParts[i];

    if (part === '.') {
      spliceOne(fromParts, i);
    } else if (part === '..') {
      spliceOne(fromParts, i);
      up++;
    } else if (up) {
      spliceOne(fromParts, i);
      up--;
    }
  }

  if (!mustEndAbs) { for (; up--; up) {
    fromParts.unshift('..');
  } }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) { fromParts.unshift(''); }

  var result = fromParts.join('/');

  if (hasTrailingSlash && result.substr(-1) !== '/') { result += '/'; }

  return result;
}
1243088
function fixPaths(paths) {
    return paths.map(path => {
        if (_.startsWith(path, '!./')) {
            return `!${path.substr(3)}`;
        } else if (_.startsWith(path, './')) {
            return path.substr(2);
        } else {
            return path;
        }
    });
}
316207
function parsePath(request) {
    let idx = (request.indexOf('?') + 1 || request.length + 1) - 1,
        filename = request.substr(0, idx),
        query = request.substr(idx);

    // 返回结果
    return { filename, query };
}
756228
function pathStrToPathArr(path) {
	path = path.substr(1).split('/').map(part => {
		// De-tokenize '/' characters in path name
		return part.replace(/~1/g, '/');
	});

	// For some reason, path arrays whose only item is an empty string cause errors.
	// In this case, we replace the path with an empty array, which seems to be fine.
	if (path.length === 1 && path[0] === '') {
		path = [];
	}

	return path;
}
487295
function replace(pathname) {
        if (typeof routesMap === 'function') {
            return routesMap(pathname) || pathname
        }

        let matched = false
        return pathname
            .split('/')
            .map(chunk => {
                // console.log(chunk);
                if (!matched) {
                    if (routesMap[chunk]) {
                        matched = true
                    }
                    return typeof routesMap[chunk] === 'string' ? routesMap[chunk] : chunk
                }
                else {
                    return chunk
                }
            })
            .join('/')
            .replace(/\/\//, '/')
    }
484811
function getFileNames(path, extension)
{
    var docPath = __dirname + '/' + path;
    var fileNames = [];
    var findPattern = new RegExp("." + extension + "$");
    var replacePattern = new RegExp("." + extension + "$","g");
    fs.readdirSync( docPath ).forEach( function(fileName ) {
        if( fileName.match( findPattern ) ) {
            fileNames.push( fileName.replace( replacePattern, "" ) );
        }
    });

    verbose && console.log('Read "' + extension + '" files from ' + docPath );

    return fileNames;
}
1339273
def _should_ignore(self, path):
        
        for ignore in self.options.ignores:
            if fnmatch.fnmatch(path, ignore):
                return True
        return False
618397
function get(target, path) {
    var result = target;
    for (var i = 0; i < path.length; i++) {
        result = result ? result[path[i]] : result;
    }
    return result;
}
319025
function find(pathname, patterns) {
  for (const entry of patterns)
    if (minimatch(pathname, entry.pattern))
      return entry.handler
  return null
}
433582
def filter_paths(pathnames, patterns=None, ignore_patterns=None):
    """"""
    result = []
    if patterns is None:
        patterns = ['*']
    if ignore_patterns is None:
        ignore_patterns = []
    for pathname in pathnames:
        if match_patterns(pathname, patterns) and not match_patterns(pathname, ignore_patterns):
            result.append(pathname)
    return result
636516
public static boolean excludePath(String path) {
        String[] excludePatterns = SiteProperties.getExcludePatterns();
        if (ArrayUtils.isNotEmpty(excludePatterns)) {
            return RegexUtils.matchesAny(path, excludePatterns);
        } else {
            return false;
        }
    }