Socket
Socket
Sign inDemoInstall

@babel/cli

Package Overview
Dependencies
165
Maintainers
6
Versions
122
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.13.16 to 7.14.3

26

lib/babel-external-helpers.js
"use strict";
function _commander() {
const data = require("commander");
_commander = function () {
return data;
};
return data;
}
function _core() {

@@ -13,4 +23,2 @@ const data = require("@babel/core");

const commander = require("commander");
function collect(value, previousValue) {

@@ -22,6 +30,10 @@ if (typeof value !== "string") return previousValue;

commander.option("-l, --whitelist [whitelist]", "Whitelist of helpers to ONLY include", collect);
commander.option("-t, --output-type [type]", "Type of output (global|umd|var)", "global");
commander.usage("[options]");
commander.parse(process.argv);
console.log((0, _core().buildExternalHelpers)(commander.whitelist, commander.outputType));
_commander().option("-l, --whitelist [whitelist]", "Whitelist of helpers to ONLY include", collect);
_commander().option("-t, --output-type [type]", "Type of output (global|umd|var)", "global");
_commander().usage("[options]");
_commander().parse(process.argv);
console.log((0, _core().buildExternalHelpers)(_commander().whitelist, _commander().outputType));

@@ -8,18 +8,38 @@ "use strict";

var util = _interopRequireWildcard(require("./util"));
function _slash() {
const data = require("slash");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
_slash = function () {
return data;
};
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
return data;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _path() {
const data = require("path");
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
_path = function () {
return data;
};
const slash = require("slash");
return data;
}
const path = require("path");
function _fs() {
const data = require("fs");
const fs = require("fs");
_fs = function () {
return data;
};
return data;
}
var util = require("./util");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
const FILE_TYPE = Object.freeze({

@@ -33,6 +53,7 @@ NON_COMPILABLE: "NON_COMPILABLE",

function outputFileSync(filePath, data) {
(((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "10.12") ? fs.mkdirSync : require("make-dir").sync)(path.dirname(filePath), {
(((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "10.12") ? _fs().mkdirSync : require("make-dir").sync)(_path().dirname(filePath), {
recursive: true
});
fs.writeFileSync(filePath, data);
_fs().writeFileSync(filePath, data);
}

@@ -57,3 +78,3 @@

_write = _asyncToGenerator(function* (src, base) {
let relative = path.relative(base, src);
let relative = _path().relative(base, src);

@@ -64,3 +85,3 @@ if (!util.isCompilableExtension(relative, cliOptions.extensions)) {

relative = util.withExtension(relative, cliOptions.keepFileExtension ? path.extname(relative) : cliOptions.outFileExtension);
relative = util.withExtension(relative, cliOptions.keepFileExtension ? _path().extname(relative) : cliOptions.outFileExtension);
const dest = getDest(relative, base);

@@ -70,3 +91,3 @@

const res = yield util.compile(src, Object.assign({}, babelOptions, {
sourceFileName: slash(path.relative(dest + "/..", src))
sourceFileName: _slash()(_path().relative(dest + "/..", src))
}));

@@ -78,3 +99,3 @@ if (!res) return FILE_TYPE.IGNORED;

res.code = util.addSourceMappingUrl(res.code, mapLoc);
res.map.file = path.basename(relative);
res.map.file = _path().basename(relative);
outputFileSync(mapLoc, JSON.stringify(res.map));

@@ -105,6 +126,6 @@ }

if (cliOptions.relative) {
return path.join(base, cliOptions.outDir, filename);
return _path().join(base, cliOptions.outDir, filename);
}
return path.join(cliOptions.outDir, filename);
return _path().join(cliOptions.outDir, filename);
}

@@ -121,5 +142,6 @@

if (cliOptions.copyFiles && written === FILE_TYPE.NON_COMPILABLE || cliOptions.copyIgnored && written === FILE_TYPE.IGNORED) {
const filename = path.relative(base, src);
const filename = _path().relative(base, src);
const dest = getDest(filename, base);
outputFileSync(dest, fs.readFileSync(src));
outputFileSync(dest, _fs().readFileSync(src));
util.chmod(src, dest);

@@ -139,5 +161,6 @@ }

_handle = _asyncToGenerator(function* (filenameOrDir) {
if (!fs.existsSync(filenameOrDir)) return 0;
const stat = fs.statSync(filenameOrDir);
if (!_fs().existsSync(filenameOrDir)) return 0;
const stat = _fs().statSync(filenameOrDir);
if (stat.isDirectory()) {

@@ -149,3 +172,4 @@ const dirname = filenameOrDir;

for (const filename of files) {
const src = path.join(dirname, filename);
const src = _path().join(dirname, filename);
const written = yield handleFile(src, dirname);

@@ -158,3 +182,3 @@ if (written) count += 1;

const filename = filenameOrDir;
const written = yield handleFile(filename, path.dirname(filename));
const written = yield handleFile(filename, _path().dirname(filename));
return written ? 1 : 0;

@@ -184,3 +208,3 @@ }

(((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "10.12") ? fs.mkdirSync : require("make-dir").sync)(cliOptions.outDir, {
(((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "10.12") ? _fs().mkdirSync : require("make-dir").sync)(cliOptions.outDir, {
recursive: true

@@ -219,3 +243,3 @@ });

try {
yield handleFile(filename, filename === filenameOrDir ? path.dirname(filenameOrDir) : filenameOrDir);
yield handleFile(filename, filename === filenameOrDir ? _path().dirname(filenameOrDir) : filenameOrDir);
compiledFiles++;

@@ -222,0 +246,0 @@ } catch (err) {

@@ -8,22 +8,58 @@ "use strict";

var util = _interopRequireWildcard(require("./util"));
function _convertSourceMap() {
const data = require("convert-source-map");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
_convertSourceMap = function () {
return data;
};
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
return data;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _sourceMap() {
const data = require("source-map");
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
_sourceMap = function () {
return data;
};
const convertSourceMap = require("convert-source-map");
return data;
}
const sourceMap = require("source-map");
function _slash() {
const data = require("slash");
const slash = require("slash");
_slash = function () {
return data;
};
const path = require("path");
return data;
}
const fs = require("fs");
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
var util = require("./util");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
function _default(_x) {

@@ -39,4 +75,4 @@ return _ref.apply(this, arguments);

function buildResult(fileResults) {
const map = new sourceMap.SourceMapGenerator({
file: cliOptions.sourceMapTarget || path.basename(cliOptions.outFile || "") || "stdout",
const map = new (_sourceMap().SourceMapGenerator)({
file: cliOptions.sourceMapTarget || _path().basename(cliOptions.outFile || "") || "stdout",
sourceRoot: babelOptions.sourceRoot

@@ -52,3 +88,3 @@ });

if (result.map) {
const consumer = new sourceMap.SourceMapConsumer(result.map);
const consumer = new (_sourceMap().SourceMapConsumer)(result.map);
const sources = new Set();

@@ -81,3 +117,3 @@ consumer.eachMapping(function (mapping) {

if (babelOptions.sourceMaps === "inline" || !cliOptions.outFile && babelOptions.sourceMaps) {
code += "\n" + convertSourceMap.fromObject(map).toComment();
code += "\n" + _convertSourceMap().fromObject(map).toComment();
}

@@ -95,3 +131,3 @@

if (cliOptions.outFile) {
(((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "10.12") ? fs.mkdirSync : require("make-dir").sync)(path.dirname(cliOptions.outFile), {
(((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "10.12") ? _fs().mkdirSync : require("make-dir").sync)(_path().dirname(cliOptions.outFile), {
recursive: true

@@ -103,6 +139,7 @@ });

result.code = util.addSourceMappingUrl(result.code, mapLoc);
fs.writeFileSync(mapLoc, JSON.stringify(result.map));
_fs().writeFileSync(mapLoc, JSON.stringify(result.map));
}
fs.writeFileSync(cliOptions.outFile, result.code);
_fs().writeFileSync(cliOptions.outFile, result.code);
} else {

@@ -151,9 +188,10 @@ process.stdout.write(result.code + "\n");

filenames.forEach(function (filename) {
if (!fs.existsSync(filename)) return;
const stat = fs.statSync(filename);
if (!_fs().existsSync(filename)) return;
const stat = _fs().statSync(filename);
if (stat.isDirectory()) {
const dirname = filename;
util.readdirForCompilable(filename, cliOptions.includeDotfiles, cliOptions.extensions).forEach(function (filename) {
_filenames.push(path.join(dirname, filename));
_filenames.push(_path().join(dirname, filename));
});

@@ -169,6 +207,6 @@ } else {

if (cliOptions.outFile) {
sourceFilename = path.relative(path.dirname(cliOptions.outFile), sourceFilename);
sourceFilename = _path().relative(_path().dirname(cliOptions.outFile), sourceFilename);
}
sourceFilename = slash(sourceFilename);
sourceFilename = _slash()(sourceFilename);

@@ -175,0 +213,0 @@ try {

#!/usr/bin/env node
"use strict";
var _options = _interopRequireDefault(require("./options"));
var _options = require("./options");
var _dir = _interopRequireDefault(require("./dir"));
var _dir = require("./dir");
var _file = _interopRequireDefault(require("./file"));
var _file = require("./file");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const opts = (0, _options.default)(process.argv);

@@ -13,0 +11,0 @@

@@ -8,2 +8,22 @@ "use strict";

function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _commander() {
const data = require("commander");
_commander = function () {
return data;
};
return data;
}
function _core() {

@@ -19,63 +39,111 @@ const data = require("@babel/core");

const fs = require("fs");
function _glob() {
const data = require("glob");
const commander = require("commander");
_glob = function () {
return data;
};
const glob = require("glob");
return data;
}
commander.option("-f, --filename [filename]", "The filename to use when reading from stdin. This will be used in source-maps, errors etc.");
commander.option("--presets [list]", "A comma-separated list of preset names.", collect);
commander.option("--plugins [list]", "A comma-separated list of plugin names.", collect);
commander.option("--config-file [path]", "Path to a .babelrc file to use.");
commander.option("--env-name [name]", "The name of the 'env' to use when loading configs and plugins. " + "Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'.");
commander.option("--root-mode [mode]", "The project-root resolution mode. " + "One of 'root' (the default), 'upward', or 'upward-optional'.");
commander.option("--source-type [script|module]", "");
commander.option("--no-babelrc", "Whether or not to look up .babelrc and .babelignore files.");
commander.option("--ignore [list]", "List of glob paths to **not** compile.", collect);
commander.option("--only [list]", "List of glob paths to **only** compile.", collect);
commander.option("--no-highlight-code", "Enable or disable ANSI syntax highlighting of code frames. (on by default)");
commander.option("--no-comments", "Write comments to generated output. (true by default)");
commander.option("--retain-lines", "Retain line numbers. This will result in really ugly code.");
commander.option("--compact [true|false|auto]", "Do not include superfluous whitespace characters and line terminators.", booleanify);
commander.option("--minified", "Save as many bytes when printing. (false by default)");
commander.option("--auxiliary-comment-before [string]", "Print a comment before any injected non-user code.");
commander.option("--auxiliary-comment-after [string]", "Print a comment after any injected non-user code.");
commander.option("-s, --source-maps [true|false|inline|both]", "", booleanify);
commander.option("--source-map-target [string]", "Set `file` on returned source map.");
commander.option("--source-file-name [string]", "Set `sources[0]` on returned source map.");
commander.option("--source-root [filename]", "The root from which all sources are relative.");
_commander().option("-f, --filename [filename]", "The filename to use when reading from stdin. This will be used in source-maps, errors etc.");
_commander().option("--presets [list]", "A comma-separated list of preset names.", collect);
_commander().option("--plugins [list]", "A comma-separated list of plugin names.", collect);
_commander().option("--config-file [path]", "Path to a .babelrc file to use.");
_commander().option("--env-name [name]", "The name of the 'env' to use when loading configs and plugins. " + "Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'.");
_commander().option("--root-mode [mode]", "The project-root resolution mode. " + "One of 'root' (the default), 'upward', or 'upward-optional'.");
_commander().option("--source-type [script|module]", "");
_commander().option("--no-babelrc", "Whether or not to look up .babelrc and .babelignore files.");
_commander().option("--ignore [list]", "List of glob paths to **not** compile.", collect);
_commander().option("--only [list]", "List of glob paths to **only** compile.", collect);
_commander().option("--no-highlight-code", "Enable or disable ANSI syntax highlighting of code frames. (on by default)");
_commander().option("--no-comments", "Write comments to generated output. (true by default)");
_commander().option("--retain-lines", "Retain line numbers. This will result in really ugly code.");
_commander().option("--compact [true|false|auto]", "Do not include superfluous whitespace characters and line terminators.", booleanify);
_commander().option("--minified", "Save as many bytes when printing. (false by default)");
_commander().option("--auxiliary-comment-before [string]", "Print a comment before any injected non-user code.");
_commander().option("--auxiliary-comment-after [string]", "Print a comment after any injected non-user code.");
_commander().option("-s, --source-maps [true|false|inline|both]", "", booleanify);
_commander().option("--source-map-target [string]", "Set `file` on returned source map.");
_commander().option("--source-file-name [string]", "Set `sources[0]` on returned source map.");
_commander().option("--source-root [filename]", "The root from which all sources are relative.");
{
commander.option("--module-root [filename]", "Optional prefix for the AMD module formatter that will be prepended to the filename on module definitions.");
commander.option("-M, --module-ids", "Insert an explicit id for modules.");
commander.option("--module-id [string]", "Specify a custom name for module ids.");
_commander().option("--module-root [filename]", "Optional prefix for the AMD module formatter that will be prepended to the filename on module definitions.");
_commander().option("-M, --module-ids", "Insert an explicit id for modules.");
_commander().option("--module-id [string]", "Specify a custom name for module ids.");
}
commander.option("-x, --extensions [extensions]", "List of extensions to compile when a directory has been the input. [.es6,.js,.es,.jsx,.mjs]", collect);
commander.option("--keep-file-extension", "Preserve the file extensions of the input files.");
commander.option("-w, --watch", "Recompile files on changes.");
commander.option("--skip-initial-build", "Do not compile files before watching.");
commander.option("-o, --out-file [out]", "Compile all input files into a single file.");
commander.option("-d, --out-dir [out]", "Compile an input directory of modules into an output directory.");
commander.option("--relative", "Compile into an output directory relative to input directory or file. Requires --out-dir [out]");
commander.option("-D, --copy-files", "When compiling a directory copy over non-compilable files.");
commander.option("--include-dotfiles", "Include dotfiles when compiling and copying non-compilable files.");
commander.option("--no-copy-ignored", "Exclude ignored files when copying non-compilable files.");
commander.option("--verbose", "Log everything. This option conflicts with --quiet");
commander.option("--quiet", "Don't log anything. This option conflicts with --verbose");
commander.option("--delete-dir-on-start", "Delete the out directory before compilation.");
commander.option("--out-file-extension [string]", "Use a specific extension for the output files");
commander.version("7.13.16" + " (@babel/core " + _core().version + ")");
commander.usage("[options] <files ...>");
commander.action(() => {});
_commander().option("-x, --extensions [extensions]", "List of extensions to compile when a directory has been the input. [.es6,.js,.es,.jsx,.mjs]", collect);
_commander().option("--keep-file-extension", "Preserve the file extensions of the input files.");
_commander().option("-w, --watch", "Recompile files on changes.");
_commander().option("--skip-initial-build", "Do not compile files before watching.");
_commander().option("-o, --out-file [out]", "Compile all input files into a single file.");
_commander().option("-d, --out-dir [out]", "Compile an input directory of modules into an output directory.");
_commander().option("--relative", "Compile into an output directory relative to input directory or file. Requires --out-dir [out]");
_commander().option("-D, --copy-files", "When compiling a directory copy over non-compilable files.");
_commander().option("--include-dotfiles", "Include dotfiles when compiling and copying non-compilable files.");
_commander().option("--no-copy-ignored", "Exclude ignored files when copying non-compilable files.");
_commander().option("--verbose", "Log everything. This option conflicts with --quiet");
_commander().option("--quiet", "Don't log anything. This option conflicts with --verbose");
_commander().option("--delete-dir-on-start", "Delete the out directory before compilation.");
_commander().option("--out-file-extension [string]", "Use a specific extension for the output files");
_commander().version("7.14.3" + " (@babel/core " + _core().version + ")");
_commander().usage("[options] <files ...>");
_commander().action(() => {});
function parseArgv(args) {
commander.parse(args);
_commander().parse(args);
const errors = [];
let filenames = commander.args.reduce(function (globbed, input) {
let files = glob.sync(input);
let filenames = _commander().args.reduce(function (globbed, input) {
let files = _glob().sync(input);
if (!files.length) files = [input];
return globbed.concat(files);
}, []);
filenames = Array.from(new Set(filenames));
filenames.forEach(function (filename) {
if (!fs.existsSync(filename)) {
if (!_fs().existsSync(filename)) {
errors.push(filename + " does not exist");

@@ -85,16 +153,16 @@ }

if (commander.outDir && !filenames.length) {
if (_commander().outDir && !filenames.length) {
errors.push("--out-dir requires filenames");
}
if (commander.outFile && commander.outDir) {
if (_commander().outFile && _commander().outDir) {
errors.push("--out-file and --out-dir cannot be used together");
}
if (commander.relative && !commander.outDir) {
if (_commander().relative && !_commander().outDir) {
errors.push("--relative requires --out-dir usage");
}
if (commander.watch) {
if (!commander.outFile && !commander.outDir) {
if (_commander().watch) {
if (!_commander().outFile && !_commander().outDir) {
errors.push("--watch requires --out-file or --out-dir");

@@ -108,19 +176,19 @@ }

if (commander.skipInitialBuild && !commander.watch) {
if (_commander().skipInitialBuild && !_commander().watch) {
errors.push("--skip-initial-build requires --watch");
}
if (commander.deleteDirOnStart && !commander.outDir) {
if (_commander().deleteDirOnStart && !_commander().outDir) {
errors.push("--delete-dir-on-start requires --out-dir");
}
if (commander.verbose && commander.quiet) {
if (_commander().verbose && _commander().quiet) {
errors.push("--verbose and --quiet cannot be used together");
}
if (!commander.outDir && filenames.length === 0 && typeof commander.filename !== "string" && commander.babelrc !== false) {
if (!_commander().outDir && filenames.length === 0 && typeof _commander().filename !== "string" && _commander().babelrc !== false) {
errors.push("stdin compilation requires either -f/--filename [filename] or --no-babelrc");
}
if (commander.keepFileExtension && commander.outFileExtension) {
if (_commander().keepFileExtension && _commander().outFileExtension) {
errors.push("--out-file-extension cannot be used with --keep-file-extension");

@@ -137,3 +205,4 @@ }

const opts = commander.opts();
const opts = _commander().opts();
const babelOptions = {

@@ -140,0 +209,0 @@ presets: opts.presets,

@@ -18,4 +18,14 @@ "use strict";

function _fsReaddirRecursive() {
const data = require("fs-readdir-recursive");
_fsReaddirRecursive = function () {
return data;
};
return data;
}
function babel() {
const data = _interopRequireWildcard(require("@babel/core"));
const data = require("@babel/core");

@@ -29,6 +39,6 @@ babel = function () {

function _module() {
const data = require("module");
function _path() {
const data = require("path");
_module = function () {
_path = function () {
return data;

@@ -40,15 +50,25 @@ };

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _fs() {
const data = require("fs");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
_fs = function () {
return data;
};
const readdirRecursive = require("fs-readdir-recursive");
return data;
}
const path = require("path");
function _module() {
const data = require("module");
const fs = require("fs");
_module = function () {
return data;
};
return data;
}
function chmod(src, dest) {
try {
fs.chmodSync(dest, fs.statSync(src).mode);
_fs().chmodSync(dest, _fs().statSync(src).mode);
} catch (err) {

@@ -60,4 +80,5 @@ console.warn(`Cannot change permissions of ${dest}`);

function readdir(dirname, includeDotfiles, filter) {
return readdirRecursive(dirname, (filename, _index, currentDirectory) => {
const stat = fs.statSync(path.join(currentDirectory, filename));
return _fsReaddirRecursive()(dirname, (filename, _index, currentDirectory) => {
const stat = _fs().statSync(_path().join(currentDirectory, filename));
if (stat.isDirectory()) return true;

@@ -76,3 +97,5 @@ return (includeDotfiles || filename[0] !== ".") && (!filter || filter(filename));

const exts = altExts || babel().DEFAULT_EXTENSIONS;
const ext = path.extname(filename);
const ext = _path().extname(filename);
return exts.includes(ext);

@@ -82,3 +105,3 @@ }

function addSourceMappingUrl(code, loc) {
return code + "\n//# sourceMappingURL=" + path.basename(loc);
return code + "\n//# sourceMappingURL=" + _path().basename(loc);
}

@@ -114,13 +137,14 @@

function deleteDir(path) {
if (fs.existsSync(path)) {
fs.readdirSync(path).forEach(function (file) {
if (_fs().existsSync(path)) {
_fs().readdirSync(path).forEach(function (file) {
const curPath = path + "/" + file;
if (fs.lstatSync(curPath).isDirectory()) {
if (_fs().lstatSync(curPath).isDirectory()) {
deleteDir(curPath);
} else {
fs.unlinkSync(curPath);
_fs().unlinkSync(curPath);
}
});
fs.rmdirSync(path);
_fs().rmdirSync(path);
}

@@ -144,4 +168,4 @@ }

function withExtension(filename, ext = ".js") {
const newBasename = path.basename(filename, path.extname(filename)) + ext;
return path.join(path.dirname(filename), newBasename);
const newBasename = _path().basename(filename, _path().extname(filename)) + ext;
return _path().join(_path().dirname(filename), newBasename);
}

@@ -148,0 +172,0 @@

{
"name": "@babel/cli",
"version": "7.13.16",
"version": "7.14.3",
"description": "Babel command line.",

@@ -43,3 +43,3 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"devDependencies": {
"@babel/core": "7.13.16",
"@babel/core": "7.14.3",
"@babel/helper-fixtures": "7.13.13",

@@ -46,0 +46,0 @@ "rimraf": "^3.0.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc