Socket
Socket
Sign inDemoInstall

@babel/core

Package Overview
Dependencies
Maintainers
4
Versions
192
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/core - npm Package Compare versions

Comparing version 7.20.7 to 7.20.12

3

lib/config/caching.js

@@ -23,3 +23,2 @@ "use strict";

};
function* genTrue() {

@@ -40,3 +39,2 @@ return true;

}
function makeCachedFunction(CallCache, handler) {

@@ -240,3 +238,2 @@ const callCacheSync = new CallCache();

}
function assertSimpleType(value) {

@@ -243,0 +240,0 @@ if ((0, _async.isThenable)(value)) {

@@ -31,3 +31,2 @@ "use strict";

var _configDescriptors = require("./config-descriptors");
const debug = _debug()("babel:config:config-chain");

@@ -83,3 +82,2 @@ function* buildPresetChain(arg, context) {

configReport = yield* configFileLogger.output();
if (babelrc === undefined) {

@@ -127,4 +125,3 @@ babelrc = validatedFile.options.babelrc;

if (context.showConfig) {
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` +
[configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
}

@@ -146,3 +143,2 @@ const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);

const absoluteRoot = context.root;
if (babelrcRoots === undefined) {

@@ -158,3 +154,2 @@ return pkgData.directories.indexOf(absoluteRoot) !== -1;

});
if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {

@@ -187,3 +182,2 @@ return pkgData.directories.indexOf(absoluteRoot) !== -1;

}));
const loadProgrammaticChain = makeChainWalker({

@@ -196,3 +190,2 @@ root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),

});
const loadFileChainWalker = makeChainWalker({

@@ -309,3 +302,2 @@ root: file => loadFileDescriptors(file),

}
if (flattenedConfigs.some(({

@@ -390,3 +382,2 @@ config: {

delete options.exclude;
if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) {

@@ -415,3 +406,2 @@ options.sourceMaps = options.sourceMap;

descriptors.push(desc);
if (!item.ownPass) nameMap.set(item.name, desc);

@@ -441,3 +431,2 @@ } else {

}
function ignoreListReplacer(_key, value) {

@@ -449,3 +438,2 @@ if (value instanceof RegExp) {

}
function shouldIgnore(context, ignore, only, dirname) {

@@ -472,3 +460,2 @@ if (ignore && matchesPatterns(context, ignore, dirname)) {

}
function matchesPatterns(context, patterns, dirname, configName) {

@@ -475,0 +462,0 @@ return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName));

17

lib/config/config-descriptors.js

@@ -33,3 +33,2 @@ "use strict";

}
function createCachedDescriptors(dirname, options, alias) {

@@ -43,9 +42,6 @@ const {

options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
plugins: plugins ? () =>
createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
presets: presets ? () =>
createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
};
}
function createUncachedDescriptors(dirname, options, alias) {

@@ -63,4 +59,3 @@ return {

const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
return descriptors.map(
desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
}));

@@ -73,9 +68,6 @@ });

const descriptors = yield* createPluginDescriptors(items, dirname, alias);
return descriptors.map(
desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
});
});
const DEFAULT_OPTIONS = {};
function loadCachedDescriptor(cache, desc) {

@@ -121,3 +113,2 @@ const {

}
function* createDescriptor(pair, dirname, {

@@ -124,0 +115,0 @@ type,

@@ -73,3 +73,2 @@ "use strict";

}
if (LOADING_CONFIGS.has(filepath)) {

@@ -100,3 +99,2 @@ cache.never();

}
if (typeof options.then === "function") {

@@ -230,3 +228,2 @@ throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath);

}
function readConfig(filepath, envName, caller) {

@@ -233,0 +230,0 @@ const ext = _path().extname(filepath);

@@ -21,5 +21,3 @@ "use strict";

} catch (_unused) {}
const importMetaResolveP = import_ &&
process.execArgv.includes("--experimental-import-meta-resolve") ? import_("data:text/javascript,export default import.meta.resolve").then(m => m.default || _importMetaResolve.resolve, () => _importMetaResolve.resolve) : Promise.resolve(_importMetaResolve.resolve);
const importMetaResolveP = import_ && process.execArgv.includes("--experimental-import-meta-resolve") ? import_("data:text/javascript,export default import.meta.resolve").then(m => m.default || _importMetaResolve.resolve, () => _importMetaResolve.resolve) : Promise.resolve(_importMetaResolve.resolve);
function resolve(_x, _x2) {

@@ -26,0 +24,0 @@ return _resolve.apply(this, arguments);

@@ -17,7 +17,5 @@ "use strict";

exports.resolveShowConfigPath = resolveShowConfigPath;
function findConfigUpwards(
rootDir) {
function findConfigUpwards(rootDir) {
return null;
}
function* findPackageData(filepath) {

@@ -31,7 +29,3 @@ return {

}
function* findRelativeConfig(
pkgData,
envName,
caller) {
function* findRelativeConfig(pkgData, envName, caller) {
return {

@@ -42,22 +36,12 @@ config: null,

}
function* findRootConfig(
dirname,
envName,
caller) {
function* findRootConfig(dirname, envName, caller) {
return null;
}
function* loadConfig(name, dirname,
envName,
caller) {
function* loadConfig(name, dirname, envName, caller) {
throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
}
function* resolveShowConfigPath(
dirname) {
function* resolveShowConfigPath(dirname) {
return null;
}
const ROOT_CONFIG_FILENAMES = [];
exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;

@@ -67,3 +51,2 @@ function resolvePlugin(name, dirname) {

}
function resolvePreset(name, dirname) {

@@ -70,0 +53,0 @@ return null;

@@ -45,7 +45,5 @@ "use strict";

} catch (_unused) {}
const supportsESM = _semver().satisfies(process.versions.node,
"^12.17 || >=13.2");
const supportsESM = _semver().satisfies(process.versions.node, "^12.17 || >=13.2");
exports.supportsESM = supportsESM;
function* loadCjsOrMjsDefault(filepath, asyncError,
fallbackToTranspiledModule = false) {
function* loadCjsOrMjsDefault(filepath, asyncError, fallbackToTranspiledModule = false) {
switch (guessJSModuleType(filepath)) {

@@ -79,4 +77,3 @@ case "cjs":

const module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath);
return module != null && module.__esModule ?
module.default || (fallbackToTranspiledModule ? module : undefined) : module;
return module != null && module.__esModule ? module.default || (fallbackToTranspiledModule ? module : undefined) : module;
}

@@ -91,3 +88,2 @@ function loadMjsDefault(_x) {

}
const module = yield (0, _rewriteStackTrace.endHiddenCallStack)(import_)((0, _url().pathToFileURL)(filepath));

@@ -94,0 +90,0 @@ return module.default;

@@ -37,3 +37,2 @@ "use strict";

});
function* findPackageData(filepath) {

@@ -40,0 +39,0 @@ let pkg = null;

@@ -86,8 +86,3 @@ "use strict";

const isPreset = type === "preset";
return name
.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`)
.replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`)
.replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`)
.replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`)
.replace(EXACT_RE, "");
return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, "");
}

@@ -101,3 +96,2 @@ function* resolveAlternativesHelper(type, name) {

if (!error) return value;
if (error.code !== "MODULE_NOT_FOUND") throw error;

@@ -221,4 +215,3 @@ if (standardizedName !== name && !(yield name).error) {

}
return yield* (0, _moduleTypes.default)(name, `You appear to be using a native ECMAScript module ${type}, ` + "which is only supported when running Babel asynchronously.",
true);
return yield* (0, _moduleTypes.default)(name, `You appear to be using a native ECMAScript module ${type}, ` + "which is only supported when running Babel asynchronously.", true);
} catch (err) {

@@ -225,0 +218,0 @@ err.message = `[BABEL]: ${err.message} (While processing: ${name})`;

@@ -85,3 +85,2 @@ "use strict";

externalDependencies.push(preset.externalDependencies);
if (descriptor.ownPass) {

@@ -100,3 +99,2 @@ presets.push({

}
if (presets.length > 0) {

@@ -171,3 +169,2 @@ pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass));

}
const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function* ({

@@ -259,3 +256,2 @@ value,

});
function* loadPluginDescriptor(descriptor, context) {

@@ -301,3 +297,2 @@ if (descriptor.value instanceof _plugin.default) {

});
function* loadPresetDescriptor(descriptor, context) {

@@ -304,0 +299,0 @@ const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context));

@@ -42,4 +42,3 @@ "use strict";

function makePresetAPI(cache, externalDependencies) {
const targets = () =>
JSON.parse(cache.using(data => JSON.stringify(data.targets)));
const targets = () => JSON.parse(cache.using(data => JSON.stringify(data.targets)));
const addExternalDependency = ref => {

@@ -46,0 +45,0 @@ externalDependencies.push(ref);

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

exports.flattenToSet = flattenToSet;
function finalize(deepArr) {

@@ -11,0 +10,0 @@ return Object.freeze(deepArr);

@@ -20,3 +20,2 @@ "use strict";

}
function* createConfigItem(value, {

@@ -40,3 +39,2 @@ dirname = ".",

class ConfigItem {
constructor(descriptor) {

@@ -65,3 +63,2 @@ this._descriptor = void 0;

} : undefined;
Object.freeze(this);

@@ -68,0 +65,0 @@ }

@@ -144,3 +144,2 @@ "use strict";

class PartialConfig {
constructor(options, babelrc, ignore, config, fileHandling, files) {

@@ -159,6 +158,4 @@ this.options = void 0;

this.files = files;
Object.freeze(this);
}
hasFilesystemConfig() {

@@ -165,0 +162,0 @@ return this.babelrc !== undefined || this.config !== undefined;

@@ -24,3 +24,2 @@ "use strict";

}
function pathToPattern(pattern, dirname) {

@@ -30,11 +29,7 @@ const parts = _path().resolve(dirname, pattern).split(_path().sep);

const last = i === parts.length - 1;
if (part === "**") return last ? starStarPatLast : starStarPat;
if (part === "*") return last ? starPatLast : starPat;
if (part.indexOf("*.") === 0) {
return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep);
}
return escapeRegExp(part) + (last ? endSep : sep);

@@ -41,0 +36,0 @@ })].join(""));

@@ -15,9 +15,6 @@ "use strict";

}
function resolveBrowserslistConfigFile(
browserslistConfigFile,
configFilePath) {
function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) {
return undefined;
}
function resolveTargets(options,
root) {
function resolveTargets(options, root) {
const optTargets = options.targets;

@@ -24,0 +21,0 @@ let targets;

@@ -216,3 +216,2 @@ "use strict";

}
return value;

@@ -260,3 +259,2 @@ }

}
let root = loc;

@@ -279,3 +277,2 @@ do {

}
return value;

@@ -282,0 +279,0 @@ }

@@ -10,3 +10,2 @@ "use strict";

exports.injcectVirtualStackFrame = injcectVirtualStackFrame;
const ErrorToString = Function.call.bind(Error.prototype.toString);

@@ -66,3 +65,2 @@ const SUPPORTED = !!Error.captureStackTrace;

} = Error;
const MIN_STACK_TRACE_LIMIT = 50;

@@ -69,0 +67,0 @@ Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, MIN_STACK_TRACE_LIMIT));

@@ -23,3 +23,2 @@ "use strict";

});
const isAsync = _gensync()({

@@ -29,3 +28,2 @@ sync: () => false,

});
exports.isAsync = isAsync;

@@ -55,3 +53,2 @@ function maybeAsync(fn, message) {

});
function forwardAsync(action, cb) {

@@ -64,3 +61,2 @@ const g = _gensync()(action);

}
const onFirstPause = _gensync()({

@@ -83,3 +79,2 @@ name: "onFirstPause",

});
exports.onFirstPause = onFirstPause;

@@ -86,0 +81,0 @@ const waitFor = _gensync()({

@@ -227,6 +227,5 @@ "use strict";

var _parse = require("./parse");
const version = "7.20.7";
const version = "7.20.12";
exports.version = version;
const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;

@@ -233,0 +232,0 @@ class OptionManager {

@@ -54,3 +54,2 @@ "use strict";

}
const {

@@ -57,0 +56,0 @@ loc,

@@ -291,3 +291,2 @@ "use strict";

};
pluginNameMap.privateIn.syntax = pluginNameMap.privateIn.transform;

@@ -298,3 +297,2 @@ const getNameURLCombination = ({

}) => `${name} (${url})`;
function generateMissingPluginMessage(missingPluginName, loc, codeFrame) {

@@ -301,0 +299,0 @@ let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;

@@ -74,4 +74,3 @@ "use strict";

const container = functionExpression(null, [identifier("global")], blockStatement(body));
const tree = program([expressionStatement(callExpression(container, [
conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))]));

@@ -78,0 +77,0 @@ buildHelpers(body, namespace, allowlist);

@@ -9,3 +9,2 @@ "use strict";

exports.transformFileSync = transformFileSync;
const transformFile = function transformFile(filename, opts, callback) {

@@ -12,0 +11,0 @@ if (typeof opts === "function") {

@@ -29,3 +29,2 @@ "use strict";

});
function transformFile(...args) {

@@ -32,0 +31,0 @@ return transformFileRunner.errback(...args);

@@ -17,3 +17,2 @@ "use strict";

const blockHoistPlugin = {
name: "internal.blockHoist",

@@ -28,3 +27,2 @@ visitor: {

} = node;
let max = Math.pow(2, 30) - 1;

@@ -42,3 +40,2 @@ let hasChange = false;

if (!hasChange) return;
node.body = stableSort(body.slice());

@@ -65,11 +62,8 @@ }

const buckets = Object.create(null);
for (let i = 0; i < body.length; i++) {
const n = body[i];
const p = priority(n);
const bucket = buckets[p] || (buckets[p] = []);
bucket.push(n);
}
const keys = Object.keys(buckets).map(k => +k).sort((a, b) => b - a);

@@ -76,0 +70,0 @@ let index = 0;

@@ -97,3 +97,2 @@ "use strict";

}
get shebang() {

@@ -130,3 +129,2 @@ const {

}
availableHelper(name, versionRange) {

@@ -141,3 +139,2 @@ let minVersion;

if (typeof versionRange !== "string") return true;
if (_semver().valid(versionRange)) versionRange = `^${versionRange}`;

@@ -154,3 +151,2 @@ return !_semver().intersects(`<${minVersion}`, versionRange) && !_semver().intersects(`>=8.0.0`, versionRange);

}
helpers().ensure(name, File);

@@ -157,0 +153,0 @@ const uid = this.declarations[name] = this.scope.generateUidIdentifier(name);

@@ -55,3 +55,2 @@ "use strict";

}
let {

@@ -58,0 +57,0 @@ code: outputCode,

@@ -16,3 +16,2 @@ "use strict";

const source = sourceFileName.replace(/\\/g, "/");
let found = false;

@@ -30,3 +29,2 @@ const result = _remapping()(rootless(map), (s, ctx) => {

}
return Object.assign({}, result);

@@ -33,0 +31,0 @@ }

@@ -74,3 +74,2 @@ "use strict";

const result = fn.call(pass, file);
yield* [];

@@ -82,3 +81,2 @@ if (isThenable(result)) {

}
const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);

@@ -90,3 +88,2 @@ (0, _traverse().default)(file.ast, visitor, file.scope);

const result = fn.call(pass, file);
yield* [];

@@ -93,0 +90,0 @@ if (isThenable(result)) {

@@ -51,3 +51,2 @@ "use strict";

const LARGE_INPUT_SOURCEMAP_THRESHOLD = 3000000;
const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;

@@ -93,4 +92,3 @@ const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;

} else {
inputMap = _convertSourceMap().fromJSON(
inputMapContent);
inputMap = _convertSourceMap().fromJSON(inputMapContent);
}

@@ -97,0 +95,0 @@ } catch (err) {

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

class PluginPass {
constructor(file, key, options) {

@@ -11,0 +10,0 @@ this._map = new Map();

{
"name": "@babel/core",
"version": "7.20.7",
"version": "7.20.12",
"description": "Babel compiler core.",

@@ -53,7 +53,7 @@ "main": "./lib/index.js",

"@babel/helper-compilation-targets": "^7.20.7",
"@babel/helper-module-transforms": "^7.20.7",
"@babel/helper-module-transforms": "^7.20.11",
"@babel/helpers": "^7.20.7",
"@babel/parser": "^7.20.7",
"@babel/template": "^7.20.7",
"@babel/traverse": "^7.20.7",
"@babel/traverse": "^7.20.12",
"@babel/types": "^7.20.7",

@@ -63,3 +63,3 @@ "convert-source-map": "^1.7.0",

"gensync": "^1.0.0-beta.2",
"json5": "^2.2.1",
"json5": "^2.2.2",
"semver": "^6.3.0"

@@ -71,3 +71,3 @@ },

"@babel/plugin-transform-flow-strip-types": "^7.19.0",
"@babel/plugin-transform-modules-commonjs": "^7.20.7",
"@babel/plugin-transform-modules-commonjs": "^7.20.11",
"@babel/preset-env": "^7.20.2",

@@ -74,0 +74,0 @@ "@jridgewell/trace-mapping": "^0.3.8",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc