How to use the minimatch.braceExpand 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 / braces / test / support / generate.js View on Github external
'use strict';

var braces = require('../..');
var mm = require('minimatch');
var text = require('text-table');
var Time = require('time-diff');
var time = new Time();

var table = [
  ['**Pattern**', '**braces**', '**minimatch**'],
  ['---', '---', '---']
];

// warm up both libs
mm.braceExpand('{a,b}');
braces('{a,b}');

function generate(pattern) {
  time.start('braces');
  var bval = braces(pattern, {rangeLimit: false}).join('|');
  var b = [wrap(format(bval.length)), '(' + time.end('braces', 'μs') + ')'].join(' ');

  time.start('minimatch');
  var mval = mm.braceExpand(pattern).join('|');
  var m = [wrap(format(mval.length)), '(' + time.end('minimatch', 'μs') + ')'].join(' ');

  table.push([wrap(pattern), b, m]);
  return table;
}

function wrap(str) {
github micromatch / braces / test / support / generate.js View on Github external
function generate(pattern) {
  time.start('braces');
  var bval = braces(pattern, {rangeLimit: false}).join('|');
  var b = [wrap(format(bval.length)), '(' + time.end('braces', 'μs') + ')'].join(' ');

  time.start('minimatch');
  var mval = mm.braceExpand(pattern).join('|');
  var m = [wrap(format(mval.length)), '(' + time.end('minimatch', 'μs') + ')'].join(' ');

  table.push([wrap(pattern), b, m]);
  return table;
}
github micromatch / nanomatch / test / support / matcher.js View on Github external
mm.braces = function(pattern, options) {
  return minimatch.braceExpand(pattern, options);
};
github micromatch / micromatch / test / support / matcher.js View on Github external
mm.braces = function(pattern, options) {
  return minimatch.braceExpand(pattern, options);
};
github micromatch / braces / bench / index.js View on Github external
  .add('minimatch', () => minimatch.braceExpand('foo/{a,b,c}/bar'))
  .run();
github micromatch / braces / bench / index.js View on Github external
  .add('minimatch', () => minimatch.braceExpand('foo/{a,b,{x,y,z}}/bar'))
  .run();
github micromatch / micromatch / bench / index.js View on Github external
  .add('minimatch', () => mm.braceExpand('foo/{a,b,{1..250}}/bar'))
  .run();
github micromatch / micromatch / bench / index.js View on Github external
  .add('minimatch', () => mm.braceExpand('foo/{1..250}/bar'))
  .run();
github micromatch / braces / bench / index.js View on Github external
  .add('minimatch', () => minimatch.braceExpand('foo/{a,b,{1..250}}/bar'))
  .run();