code: function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
    const patternList = [].concat(patterns);
    const excludedPatternList = [].concat(excludedPatterns || []);
    const opts = { matchBase: true };
  
    return (
      patternList.some(pattern => minimatch(filePath, pattern, opts)) &&
      !excludedPatternList.some(excludedPattern =>
        minimatch(filePath, excludedPattern, opts)
      )
    );
  }
docs: Based on eslint: https://github.com/eslint/eslint/blob/master/lib/config/config-ops.js