Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
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);
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);
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);
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);
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);
}
}
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
}
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
}
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);
}
}
//
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);