How to use the babel-core.util.regexify function in babel-core

To help you get started, we’ve selected a few babel-core 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 parcel-bundler / parcel / src / transforms / babel.js View on Github external
function shouldIgnoreBabelrc(filename, babelrc) {
  // Determine if we should ignore this babelrc file. We do this here instead of
  // letting babel-core handle it because this config might be merged with our
  // autogenerated one later which shouldn't be ignored.
  let ignore = babelUtils.arrayify(babelrc.ignore, babelUtils.regexify);
  let only =
    babelrc.only && babelUtils.arrayify(babelrc.only, babelUtils.regexify);
  return babelUtils.shouldIgnore(filename, ignore, only);
}
github charlieschwabacher / gestalt / node_modules / babel-cli / lib / babel / index.js View on Github external
if (errors.length) {
  console.error(errors.join(". "));
  process.exit(2);
}

//

var opts = exports.opts = {};

each(options, function (opt, key) {
  if (commander[key] !== undefined) {
    opts[key] = commander[key];
  }
});

opts.ignore = util.arrayify(opts.ignore, util.regexify);

if (opts.only) {
  opts.only = util.arrayify(opts.only, util.regexify);
}

var fn = /*istanbul ignore next*/void 0;

if (commander.outDir) {
  fn = require("./dir");
} else {
  fn = require("./file");
}

fn(commander, filenames, exports.opts);
github alexpopdev / underscorejs-examples / advanced-topics / es6-examples / node_modules / babel / lib / babel / index.js View on Github external
if (errors.length) {
  console.error(errors.join(". "));
  process.exit(2);
}

//

var opts = exports.opts = {};

each(options, function (opt, key) {
  if (commander[key] !== undefined) {
    opts[key] = commander[key];
  }
});

opts.ignore = util.arrayify(opts.ignore, util.regexify);

if (opts.only) {
  opts.only = util.arrayify(opts.only, util.regexify);
}

var fn;

if (commander.outDir) {
  fn = require("./dir");
} else {
  fn = require("./file");
}

fn(commander, filenames, exports.opts);
github ndp / csster / node_modules / babel-cli / lib / babel / index.js View on Github external
if (errors.length) {
  console.error(errors.join(". "));
  process.exit(2);
}

var opts = exports.opts = {};

(0, _keys2.default)(options).forEach(function (key) {
  var opt = options[key];
  if (commander[key] !== undefined && commander[key] !== opt.default) {
    opts[key] = commander[key];
  }
});

opts.ignore = util.arrayify(opts.ignore, util.regexify);

if (opts.only) {
  opts.only = util.arrayify(opts.only, util.regexify);
}

var fn = void 0;

if (commander.outDir) {
  fn = require("./dir");
} else {
  fn = require("./file");
}

fn(commander, filenames, exports.opts);
github bradtraversy / youtube_es2015_source / 01_babel / node_modules / babel-cli / lib / babel / index.js View on Github external
if (errors.length) {
  console.error(errors.join(". "));
  process.exit(2);
}

//

var opts = exports.opts = {};

each(options, function (opt, key) {
  if (commander[key] !== undefined) {
    opts[key] = commander[key];
  }
});

opts.ignore = util.arrayify(opts.ignore, util.regexify);

if (opts.only) {
  opts.only = util.arrayify(opts.only, util.regexify);
}

var fn = /*istanbul ignore next*/void 0;

if (commander.outDir) {
  fn = require("./dir");
} else {
  fn = require("./file");
}

fn(commander, filenames, exports.opts);
github power-assert-js / espower-babel / lib / babelrc-util.js View on Github external
function shouldIgnoreByBabel(filename, babelrc) {
    if (!babelrc.ignore && !babelrc.only) {
        return /node_modules/.test(filename);
    } else {
        var ignore = babelrc.ignore ? util.arrayify(babelrc.ignore, util.regexify) : null;
        var only = babelrc.only ? util.arrayify(babelrc.only, util.regexify) : null;
        return util.shouldIgnore(filename, ignore, only);
    }
}
github dtinth / babel-plugin-__coverage__ / src / index.js View on Github external
function skip ({ opts, file } = { }) {
  if (file && opts) {
    const { ignore = [], only } = opts
    return util.shouldIgnore(
      file.opts.filename,
      util.arrayify(ignore, util.regexify),
      only ? util.arrayify(only, util.regexify) : null
    )
  }
  return false
}
github dtinth / babel-plugin-__coverage__ / src / index.js View on Github external
function skip ({ opts, file } = { }) {
  if (file && opts) {
    const { ignore = [], only } = opts
    return util.shouldIgnore(
      file.opts.filename,
      util.arrayify(ignore, util.regexify),
      only ? util.arrayify(only, util.regexify) : null
    )
  }
  return false
}
github joshuaslate / saas-tutorial / node_modules / babel-register / src / node.js View on Github external
export default function (opts?: Object = {}) {
  if (opts.only != null) only = util.arrayify(opts.only, util.regexify);
  if (opts.ignore != null) ignore = util.arrayify(opts.ignore, util.regexify);

  if (opts.extensions) hookExtensions(util.arrayify(opts.extensions));

  if (opts.cache === false) cache = null;

  delete opts.extensions;
  delete opts.ignore;
  delete opts.cache;
  delete opts.only;

  extend(transformOpts, opts);
}
github Caltech-IPAC / firefly / node_modules / babel / bin / babel / index.js View on Github external
}

//

var opts = exports.opts = {};

each(options, function (opt, key) {
  if (commander[key] !== undefined) {
    opts[key] = commander[key];
  }
});

opts.ignore = util.arrayify(opts.ignore, util.regexify);

if (opts.only) {
  opts.only = util.arrayify(opts.only, util.regexify);
}

var fn;

if (commander.outDir) {
  fn = require("./dir");
} else {
  fn = require("./file");
}

fn(commander, filenames, exports.opts);