How to use the minimatch.match function in minimatch

To help you get started, we’ve selected a few minimatch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github micromatch / extglob / test / support / matcher.js View on Github external
mi.match = function(files, pattern, options) {
  return minimatch.match(utils.arrayify(files), pattern, options);
};
github sx1989827 / DOClever / node_modules / maximatch / index.js View on Github external
} else if (pattern instanceof RegExp) {

			return arrayUnion(ret, list.filter(function(item) {
				return pattern.test(item);
			}));

		} else {
			var process = arrayUnion;

			if (pattern[0] === '!') {
				pattern = pattern.slice(1);
				process = arrayDiffer;
			}

			return process(ret, minimatch.match(list, pattern, options));
		}
	}, []);
};
github art-software / art-core / packages / art-cli-tool / src / config / configChooseModules.ts View on Github external
argvModules.forEach((moduleEntry) => {
    let modulePattern = path.join(moduleEntry.replace(/(\*)+$/ig, '').replace(/^client/, ''), '**/*.{js,jsx,ts,tsx}');
    modulePattern = ['./', path.join('client', modulePattern)].join('');

    for (const key in allModules) {
      const matched = minimatch.match(ensureHasDotExtension(allModules[key]), modulePattern, { matchBase: true });
      if (matched.length) {
        newEntries[key] = matched;
      }
    }
  });
  return newEntries;
github SBoudrias / file-utils / lib / file.js View on Github external
return processPatterns(patterns, function(pattern) {
    return minimatch.match(filepaths, pattern, options);
  }.bind(this));
};
github sindresorhus / multimatch / index.js View on Github external
return patterns.reduce((result, pattern) => {
		let process = arrayUnion;

		if (pattern[0] === '!') {
			pattern = pattern.slice(1);
			process = arrayDiffer;
		}

		return process(result, minimatch.match(list, pattern, options));
	}, []);
};
github micromatch / micromatch / benchmark / code / match / minimatch.js View on Github external
module.exports = function(files, pattern) {
  return minimatch.match(files, pattern);
};
github anviljs / anvil.js / lib / fileCrawler.js View on Github external
_.each( filter, function( pattern ) {
			var matches = minimatch.match( list, pattern, { matchBase: true, dot: true } );
			exclusions = exclusions.concat( matches );
		} );
		return _.without( list, exclusions );
github raphamorim / mugiwara / scripts / eslint / run.js View on Github external
patterns.forEach(pattern => {
    intersection = [
      ...intersection,
      ...minimatch.match(files, pattern, {matchBase: true}),
    ];
  });
  return [...new Set(intersection)];
github micromatch / nanomatch / benchmark / code / isMatch / minimatch.js View on Github external
module.exports = function(files, pattern) {
  files = Array.isArray(files) ? files : [files];
  return minimatch.match(files, pattern).length > 0;
};