How to use extglob - 5 common examples

To help you get started, we’ve selected a few extglob 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 ifgyong / demo / React-native / Helloword / node_modules / metro-bundler / node_modules / sane / node_modules / micromatch / lib / compilers.js View on Github external
// get references to some specific nanomatch compilers before they
    // are overridden by the extglob and/or custom compilers
    var escape = compilers.escape;
    var qmark = compilers.qmark;
    var slash = compilers.slash;
    var star = compilers.star;
    var text = compilers.text;
    var plus = compilers.plus;
    var dot = compilers.dot;

    // register extglob compilers or escape exglobs if disabled
    if (opts.extglob === false || opts.noext === true) {
        snapdragon.compiler.use(escapeExtglobs);
    } else {
        snapdragon.use(extglob.compilers);
    }

    snapdragon.use(function () {
        this.options.star = this.options.star || function (/*node*/) {
            return '[^\\\\/]*?';
        };
    });

    // custom micromatch compilers
    snapdragon.compiler

    // reset referenced compiler
        .set('dot', dot)
        .set('escape', escape)
        .set('plus', plus)
        .set('slash', slash)
github micromatch / micromatch / lib / compilers.js View on Github external
// get references to some specific nanomatch compilers before they
  // are overridden by the extglob and/or custom compilers
  var escape = compilers.escape;
  var qmark = compilers.qmark;
  var slash = compilers.slash;
  var star = compilers.star;
  var text = compilers.text;
  var plus = compilers.plus;
  var dot = compilers.dot;

  // register extglob compilers or escape exglobs if disabled
  if (opts.extglob === false || opts.noext === true) {
    snapdragon.compiler.use(escapeExtglobs);
  } else {
    snapdragon.use(extglob.compilers);
  }

  snapdragon.use(function() {
    this.options.star = this.options.star || function(/*node*/) {
      return '[^\\\\/]*?';
    };
  });

  // custom micromatch compilers
  snapdragon.compiler

    // reset referenced compiler
    .set('dot', dot)
    .set('escape', escape)
    .set('plus', plus)
    .set('slash', slash)
github micromatch / micromatch / lib / parsers.js View on Github external
var parsers = snapdragon.parser.parsers;

  // register nanomatch parsers
  snapdragon.use(nanomatch.parsers);

  // get references to some specific nanomatch parsers before they
  // are overridden by the extglob and/or parsers
  var escape = parsers.escape;
  var slash = parsers.slash;
  var qmark = parsers.qmark;
  var plus = parsers.plus;
  var star = parsers.star;
  var dot = parsers.dot;

  // register extglob parsers
  snapdragon.use(extglob.parsers);

  // custom micromatch parsers
  snapdragon.parser
    .use(function() {
      // override "notRegex" created in nanomatch parser
      this.notRegex = /^!+(?!\()/;
    })
    // reset the referenced parsers
    .capture('escape', escape)
    .capture('slash', slash)
    .capture('qmark', qmark)
    .capture('star', star)
    .capture('plus', plus)
    .capture('dot', dot)

    /**
github ifgyong / demo / React-native / Helloword / node_modules / metro-bundler / node_modules / sane / node_modules / micromatch / lib / parsers.js View on Github external
var parsers = snapdragon.parser.parsers;

    // register nanomatch parsers
    snapdragon.use(nanomatch.parsers);

    // get references to some specific nanomatch parsers before they
    // are overridden by the extglob and/or parsers
    var escape = parsers.escape;
    var slash = parsers.slash;
    var qmark = parsers.qmark;
    var plus = parsers.plus;
    var star = parsers.star;
    var dot = parsers.dot;

    // register extglob parsers
    snapdragon.use(extglob.parsers);

    // custom micromatch parsers
    snapdragon.parser
        .use(function () {
            // override "notRegex" created in nanomatch parser
            this.notRegex = /^\!+(?!\()/;
        })
        // reset the referenced parsers
        .capture('escape', escape)
        .capture('slash', slash)
        .capture('qmark', qmark)
        .capture('star', star)
        .capture('plus', plus)
        .capture('dot', dot)

        /**
github krasimir / now-lambda-runner / index.js View on Github external
const matchBuilder = (dest, build) => {
    if (build.src === 'package.json' && build.config && build.config.distDir) {
      const distPath = path.normalize([build.config.distDir, dest].join('/'))
      const exist = fs.existsSync(distPath)
      if (exist) {
        return exist
      }
    }
    return extglob.isMatch(dest, '?(/)' + build.src)
  }
  const getBuilder = dest => nowConf.builds.find(build => matchBuilder(dest, build));

extglob

Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.

MIT
Latest version published 7 years ago

Package Health Score

71 / 100
Full package analysis