Socket
Socket
Sign inDemoInstall

@babel/core

Package Overview
Dependencies
52
Maintainers
4
Versions
182
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.23.2 to 7.23.7

5

lib/config/config-chain.js

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

}
const buildPresetChainWalker = makeChainWalker({
const buildPresetChainWalker = exports.buildPresetChainWalker = makeChainWalker({
root: preset => loadPresetDescriptors(preset),

@@ -50,3 +50,2 @@ env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),

});
exports.buildPresetChainWalker = buildPresetChainWalker;
const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));

@@ -195,3 +194,3 @@ const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));

const chain = yield* loadFileChainWalker(input, context, files, baseLogger);
chain == null ? void 0 : chain.files.add(input.filepath);
chain == null || chain.files.add(input.filepath);
return chain;

@@ -198,0 +197,0 @@ }

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

const debug = _debug()("babel:config:loading:files:configuration");
const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts"];
exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts"];
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];

@@ -82,3 +81,3 @@ const BABELIGNORE_FILENAME = ".babelignore";

if (typeof options.then === "function") {
options.catch == null ? void 0 : options.catch(() => {});
options.catch == null || options.catch(() => {});
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);

@@ -85,0 +84,0 @@ }

3

lib/config/files/index-browser.js

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

}
const ROOT_CONFIG_FILENAMES = [];
exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = [];
function resolvePlugin(name, dirname) {

@@ -47,0 +46,0 @@ return null;

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

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

@@ -51,0 +50,0 @@ switch (_path().extname(filepath)) {

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

var _importMetaResolve = require("../../vendor/import-meta-resolve.js");
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
const debug = _debug()("babel:config:loading:files:plugins");

@@ -43,6 +50,4 @@ const EXACT_RE = /^module:/;

const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
const resolvePlugin = resolveStandardizedName.bind(null, "plugin");
exports.resolvePlugin = resolvePlugin;
const resolvePreset = resolveStandardizedName.bind(null, "preset");
exports.resolvePreset = resolvePreset;
const resolvePlugin = exports.resolvePlugin = resolveStandardizedName.bind(null, "plugin");
const resolvePreset = exports.resolvePreset = resolveStandardizedName.bind(null, "preset");
function* loadPlugin(name, dirname) {

@@ -170,3 +175,9 @@ const filepath = resolvePlugin(name, dirname, yield* (0, _async.isAsync)());

try {
return resolveStandardizedNameForImport(type, name, dirname);
const resolved = resolveStandardizedNameForImport(type, name, dirname);
if (!(0, _fs().existsSync)(resolved)) {
throw Object.assign(new Error(`Could not resolve "${name}" in file ${dirname}.`), {
type: "MODULE_NOT_FOUND"
});
}
return resolved;
} catch (e) {

@@ -173,0 +184,0 @@ try {

@@ -34,3 +34,3 @@ "use strict";

var _configError = require("../errors/config-error.js");
var _default = _gensync()(function* loadFullConfig(inputOpts) {
var _default = exports.default = _gensync()(function* loadFullConfig(inputOpts) {
var _opts$assumptions;

@@ -154,3 +154,2 @@ const result = yield* (0, _partial.default)(inputOpts);

});
exports.default = _default;
function enhanceError(context, fn) {

@@ -278,3 +277,3 @@ return function* (arg1, arg2) {

validateIfOptionNeedsFilename(options, descriptor);
(_options$overrides = options.overrides) == null ? void 0 : _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));
(_options$overrides = options.overrides) == null || _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));
}

@@ -281,0 +280,0 @@ };

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

}
;
if (_semver().satisfies(_index.version, range)) return;

@@ -70,0 +69,0 @@ const limit = Error.stackTraceLimit;

@@ -14,7 +14,6 @@ "use strict";

}
const ChainFormatter = {
const ChainFormatter = exports.ChainFormatter = {
Programmatic: 0,
Config: 1
};
exports.ChainFormatter = ChainFormatter;
const Formatter = {

@@ -21,0 +20,0 @@ title(type, callerName, filepath) {

@@ -135,3 +135,3 @@ "use strict";

const arr = assertArray(loc, value);
arr == null ? void 0 : arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
arr == null || arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
return arr;

@@ -138,0 +138,0 @@ }

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

const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
const assumptionsNames = new Set(knownAssumptions);
exports.assumptionsNames = assumptionsNames;
const assumptionsNames = exports.assumptionsNames = new Set(knownAssumptions);
function getSource(loc) {

@@ -78,0 +77,0 @@ return loc.type === "root" ? loc.source : getSource(loc.parent);

@@ -7,3 +7,3 @@ "use strict";

exports.default = void 0;
var _default = {
var _default = exports.default = {
auxiliaryComment: {

@@ -67,5 +67,4 @@ message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"

};
exports.default = _default;
0 && 0;
//# sourceMappingURL=removed.js.map

@@ -23,7 +23,6 @@ "use strict";

});
const isAsync = _gensync()({
const isAsync = exports.isAsync = _gensync()({
sync: () => false,
errback: cb => cb(null, true)
});
exports.isAsync = isAsync;
function maybeAsync(fn, message) {

@@ -59,3 +58,3 @@ return _gensync()({

}
const onFirstPause = _gensync()({
const onFirstPause = exports.onFirstPause = _gensync()({
name: "onFirstPause",

@@ -77,4 +76,3 @@ arity: 2,

});
exports.onFirstPause = onFirstPause;
const waitFor = _gensync()({
const waitFor = exports.waitFor = _gensync()({
sync: x => x,

@@ -90,3 +88,2 @@ async: function () {

});
exports.waitFor = waitFor;
function isThenable(val) {

@@ -93,0 +90,0 @@ return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";

@@ -21,14 +21,12 @@ "use strict";

}
const readFile = _gensync()({
const readFile = exports.readFile = _gensync()({
sync: _fs().readFileSync,
errback: _fs().readFile
});
exports.readFile = readFile;
const stat = _gensync()({
const stat = exports.stat = _gensync()({
sync: _fs().statSync,
errback: _fs().stat
});
exports.stat = stat;
0 && 0;
//# sourceMappingURL=fs.js.map

@@ -11,20 +11,45 @@ "use strict";

let resultP;
let promiseReferenced = false;
return function* () {
if (result) return result;
if (!(yield* (0, _async.isAsync)())) return result = yield* fn();
if (resultP) return yield* (0, _async.waitFor)(resultP);
let resolve, reject;
resultP = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
try {
result = yield* fn();
resultP = null;
resolve(result);
return result;
} catch (error) {
reject(error);
throw error;
if (!result) {
if (resultP) {
promiseReferenced = true;
return yield* (0, _async.waitFor)(resultP);
}
if (!(yield* (0, _async.isAsync)())) {
try {
result = {
ok: true,
value: yield* fn()
};
} catch (error) {
result = {
ok: false,
value: error
};
}
} else {
let resolve, reject;
resultP = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
try {
result = {
ok: true,
value: yield* fn()
};
resultP = null;
if (promiseReferenced) resolve(result.value);
} catch (error) {
result = {
ok: false,
value: error
};
resultP = null;
if (promiseReferenced) reject(error);
}
}
}
if (result.ok) return result.value;else throw result.value;
};

@@ -31,0 +56,0 @@ }

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

;
const version = "7.23.2";
exports.version = version;
const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
const version = exports.version = "7.23.7";
const DEFAULT_EXTENSIONS = exports.DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
;

@@ -233,0 +231,0 @@ {

@@ -27,3 +27,3 @@ "use strict";

});
const parse = function parse(code, opts, callback) {
const parse = exports.parse = function parse(code, opts, callback) {
if (typeof opts === "function") {

@@ -40,3 +40,2 @@ callback = opts;

};
exports.parse = parse;
function parseSync(...args) {

@@ -43,0 +42,0 @@ return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(...args);

@@ -25,3 +25,3 @@ "use strict";

});
const transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) {
const transformFromAst = exports.transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) {
let opts;

@@ -43,3 +43,2 @@ let callback;

};
exports.transformFromAst = transformFromAst;
function transformFromAstSync(...args) {

@@ -46,0 +45,0 @@ return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args);

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

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

@@ -16,3 +16,2 @@ callback = opts;

};
exports.transformFile = transformFile;
function transformFileSync() {

@@ -19,0 +18,0 @@ throw new Error("Transforming files is not supported in browsers");

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

});
const transform = function transform(code, optsOrCallback, maybeCallback) {
const transform = exports.transform = function transform(code, optsOrCallback, maybeCallback) {
let opts;

@@ -42,3 +42,2 @@ let callback;

};
exports.transform = transform;
function transformSync(...args) {

@@ -45,0 +44,0 @@ return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(...args);

@@ -64,5 +64,4 @@ "use strict";

}
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
const isWindows = _process().platform === 'win32';
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
const own$1 = {}.hasOwnProperty;

@@ -145,4 +144,4 @@ const classRegExp = /^([A-Z][a-z\d]*)+$/;

}, Error);
codes.ERR_MODULE_NOT_FOUND = createError('ERR_MODULE_NOT_FOUND', (path, base, type = 'package') => {
return `Cannot find ${type} '${path}' imported from ${base}`;
codes.ERR_MODULE_NOT_FOUND = createError('ERR_MODULE_NOT_FOUND', (path, base, exactUrl = false) => {
return `Cannot find ${exactUrl ? 'module' : 'package'} '${path}' imported from ${base}`;
}, Error);

@@ -169,10 +168,2 @@ codes.ERR_NETWORK_IMPORT_DISALLOWED = createError('ERR_NETWORK_IMPORT_DISALLOWED', "import of '%s' by %s is not supported: %s", Error);

}, TypeError);
codes.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError('ERR_UNSUPPORTED_ESM_URL_SCHEME', (url, supported) => {
let message = `Only URLs with a scheme in: ${formatList(supported)} are supported by the default ESM loader`;
if (isWindows && url.protocol.length === 2) {
message += '. On Windows, absolute paths must be valid file:// URLs';
}
message += `. Received protocol '${url.protocol}'`;
return message;
}, Error);
function createError(sym, value, def) {

@@ -278,2 +269,7 @@ messages.set(sym, value);

}
const hasOwnProperty$1 = {}.hasOwnProperty;
const {
ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1
} = codes;
const cache = new Map();
const reader = {

@@ -283,81 +279,80 @@ read

var packageJsonReader = reader;
function read(jsonPath) {
try {
const string = _fs().default.readFileSync(_path().toNamespacedPath(_path().join(_path().dirname(jsonPath), 'package.json')), 'utf8');
return {
string
};
} catch (error) {
const exception = error;
if (exception.code === 'ENOENT') {
return {
string: undefined
};
}
throw exception;
}
}
const {
ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1
} = codes;
const packageJsonCache = new Map();
function getPackageConfig(path, specifier, base) {
const existing = packageJsonCache.get(path);
if (existing !== undefined) {
function read(jsonPath, {
base,
specifier
}) {
const existing = cache.get(jsonPath);
if (existing) {
return existing;
}
const source = packageJsonReader.read(path).string;
if (source === undefined) {
const packageConfig = {
pjsonPath: path,
exists: false,
main: undefined,
name: undefined,
type: 'none',
exports: undefined,
imports: undefined
};
packageJsonCache.set(path, packageConfig);
return packageConfig;
}
let packageJson;
let string;
try {
packageJson = JSON.parse(source);
string = _fs().default.readFileSync(_path().toNamespacedPath(jsonPath), 'utf8');
} catch (error) {
const exception = error;
throw new ERR_INVALID_PACKAGE_CONFIG$1(path, (base ? `"${specifier}" from ` : '') + (0, _url().fileURLToPath)(base || specifier), exception.message);
if (exception.code !== 'ENOENT') {
throw exception;
}
}
const {
exports,
imports,
main,
name,
type
} = packageJson;
const packageConfig = {
pjsonPath: path,
exists: true,
main: typeof main === 'string' ? main : undefined,
name: typeof name === 'string' ? name : undefined,
type: type === 'module' || type === 'commonjs' ? type : 'none',
exports,
imports: imports && typeof imports === 'object' ? imports : undefined
const result = {
exists: false,
pjsonPath: jsonPath,
main: undefined,
name: undefined,
type: 'none',
exports: undefined,
imports: undefined
};
packageJsonCache.set(path, packageConfig);
return packageConfig;
if (string !== undefined) {
let parsed;
try {
parsed = JSON.parse(string);
} catch (error_) {
const cause = error_;
const error = new ERR_INVALID_PACKAGE_CONFIG$1(jsonPath, (base ? `"${specifier}" from ` : '') + (0, _url().fileURLToPath)(base || specifier), cause.message);
error.cause = cause;
throw error;
}
result.exists = true;
if (hasOwnProperty$1.call(parsed, 'name') && typeof parsed.name === 'string') {
result.name = parsed.name;
}
if (hasOwnProperty$1.call(parsed, 'main') && typeof parsed.main === 'string') {
result.main = parsed.main;
}
if (hasOwnProperty$1.call(parsed, 'exports')) {
result.exports = parsed.exports;
}
if (hasOwnProperty$1.call(parsed, 'imports')) {
result.imports = parsed.imports;
}
if (hasOwnProperty$1.call(parsed, 'type') && (parsed.type === 'commonjs' || parsed.type === 'module')) {
result.type = parsed.type;
}
}
cache.set(jsonPath, result);
return result;
}
function getPackageScopeConfig(resolved) {
let packageJsonUrl = new (_url().URL)('package.json', resolved);
let packageJSONUrl = new (_url().URL)('package.json', resolved);
while (true) {
const packageJsonPath = packageJsonUrl.pathname;
if (packageJsonPath.endsWith('node_modules/package.json')) break;
const packageConfig = getPackageConfig((0, _url().fileURLToPath)(packageJsonUrl), resolved);
if (packageConfig.exists) return packageConfig;
const lastPackageJsonUrl = packageJsonUrl;
packageJsonUrl = new (_url().URL)('../package.json', packageJsonUrl);
if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname) break;
const packageJSONPath = packageJSONUrl.pathname;
if (packageJSONPath.endsWith('node_modules/package.json')) {
break;
}
const packageConfig = packageJsonReader.read((0, _url().fileURLToPath)(packageJSONUrl), {
specifier: resolved
});
if (packageConfig.exists) {
return packageConfig;
}
const lastPackageJSONUrl = packageJSONUrl;
packageJSONUrl = new (_url().URL)('../package.json', packageJSONUrl);
if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
break;
}
}
const packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl);
const packageConfig = {
pjsonPath: packageJsonPath,
const packageJSONPath = (0, _url().fileURLToPath)(packageJSONUrl);
return {
pjsonPath: packageJSONPath,
exists: false,

@@ -370,4 +365,2 @@ main: undefined,

};
packageJsonCache.set(packageJsonPath, packageConfig);
return packageConfig;
}

@@ -427,4 +420,15 @@ function getPackageType(url) {

if (ext === '.js') {
return getPackageType(url) === 'module' ? 'module' : 'commonjs';
const packageType = getPackageType(url);
if (packageType !== 'none') {
return packageType;
}
return 'commonjs';
}
if (ext === '') {
const packageType = getPackageType(url);
if (packageType === 'none' || packageType === 'commonjs') {
return 'commonjs';
}
return 'module';
}
const format = extensionFormatMap[ext];

@@ -440,6 +444,7 @@ if (format) return format;

function defaultGetFormatWithoutErrors(url, context) {
if (!hasOwnProperty.call(protocolHandlers, url.protocol)) {
const protocol = url.protocol;
if (!hasOwnProperty.call(protocolHandlers, protocol)) {
return null;
}
return protocolHandlers[url.protocol](url, context, true) || null;
return protocolHandlers[protocol](url, context, true) || null;
}

@@ -467,3 +472,2 @@ const {

const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
const experimentalNetworkImports = false;
const {

@@ -477,4 +481,3 @@ ERR_NETWORK_IMPORT_DISALLOWED,

ERR_PACKAGE_PATH_NOT_EXPORTED,
ERR_UNSUPPORTED_DIR_IMPORT,
ERR_UNSUPPORTED_ESM_URL_SCHEME
ERR_UNSUPPORTED_DIR_IMPORT
} = codes;

@@ -490,2 +493,5 @@ const own = {}.hasOwnProperty;

function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
if (_process().noDeprecation) {
return;
}
const pjsonPath = (0, _url().fileURLToPath)(packageJsonUrl);

@@ -496,2 +502,5 @@ const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;

function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
if (_process().noDeprecation) {
return;
}
const format = defaultGetFormatWithoutErrors(url, {

@@ -501,6 +510,10 @@ parentURL: base.href

if (format !== 'module') return;
const path = (0, _url().fileURLToPath)(url.href);
const urlPath = (0, _url().fileURLToPath)(url.href);
const pkgPath = (0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl));
const basePath = (0, _url().fileURLToPath)(base);
if (main) _process().emitWarning(`Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, ` + `excluding the full filename and extension to the resolved file at "${path.slice(pkgPath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is` + 'deprecated for ES modules.', 'DeprecationWarning', 'DEP0151');else _process().emitWarning(`No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path.slice(pkgPath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, 'DeprecationWarning', 'DEP0151');
if (!main) {
_process().emitWarning(`No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${urlPath.slice(pkgPath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, 'DeprecationWarning', 'DEP0151');
} else if (_path().resolve(pkgPath, main) !== urlPath) {
_process().emitWarning(`Package ${pkgPath} has a "main" field set to "${main}", ` + `excluding the full filename and extension to the resolved file at "${urlPath.slice(pkgPath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is ` + 'deprecated for ES modules.', 'DeprecationWarning', 'DEP0151');
}
}

@@ -552,4 +565,18 @@ function tryStatSync(path) {

function finalizeResolution(resolved, base, preserveSymlinks) {
if (encodedSepRegEx.exec(resolved.pathname) !== null) throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, 'must not include encoded "/" or "\\" characters', (0, _url().fileURLToPath)(base));
const filePath = (0, _url().fileURLToPath)(resolved);
if (encodedSepRegEx.exec(resolved.pathname) !== null) {
throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, 'must not include encoded "/" or "\\" characters', (0, _url().fileURLToPath)(base));
}
let filePath;
try {
filePath = (0, _url().fileURLToPath)(resolved);
} catch (error) {
const cause = error;
Object.defineProperty(cause, 'input', {
value: String(resolved)
});
Object.defineProperty(cause, 'module', {
value: String(base)
});
throw cause;
}
const stats = tryStatSync(filePath.endsWith('/') ? filePath.slice(-1) : filePath);

@@ -562,3 +589,5 @@ if (stats.isDirectory()) {

if (!stats.isFile()) {
throw new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && (0, _url().fileURLToPath)(base), 'module');
const error = new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && (0, _url().fileURLToPath)(base), true);
error.url = String(resolved);
throw error;
}

@@ -721,2 +750,5 @@ if (!preserveSymlinks) {

function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
if (_process().noDeprecation) {
return;
}
const pjsonPath = (0, _url().fileURLToPath)(pjsonUrl);

@@ -880,3 +912,6 @@ if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return;

}
const packageConfig = getPackageConfig(packageJsonPath, specifier, base);
const packageConfig = packageJsonReader.read(packageJsonPath, {
base,
specifier
});
if (packageConfig.exports !== undefined && packageConfig.exports !== null) {

@@ -890,3 +925,3 @@ return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions);

} while (packageJsonPath.length !== lastPath.length);
throw new ERR_MODULE_NOT_FOUND(packageName, (0, _url().fileURLToPath)(base));
throw new ERR_MODULE_NOT_FOUND(packageName, (0, _url().fileURLToPath)(base), false);
}

@@ -961,14 +996,2 @@ function isRelativeSpecifier(specifier) {

}
function throwIfUnsupportedURLProtocol(url) {
const protocol = url.protocol;
if (protocol !== 'file:' && protocol !== 'data:' && protocol !== 'node:') {
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url);
}
}
function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) {
const protocol = parsed == null ? void 0 : parsed.protocol;
if (protocol && protocol !== 'file:' && protocol !== 'data:' && (!experimentalNetworkImports || protocol !== 'https:' && protocol !== 'http:')) {
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, ['file', 'data'].concat(experimentalNetworkImports ? ['https', 'http'] : []));
}
}
function defaultResolve(specifier, context = {}) {

@@ -990,3 +1013,3 @@ const {

const protocol = parsed.protocol;
if (protocol === 'data:' || experimentalNetworkImports && (protocol === 'https:' || protocol === 'http:')) {
if (protocol === 'data:') {
return {

@@ -1003,6 +1026,4 @@ url: parsed.href,

};
throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports);
const conditions = getConditionsSet(context.conditions);
const url = moduleResolve(specifier, new (_url().URL)(parentURL), conditions, false);
throwIfUnsupportedURLProtocol(url);
return {

@@ -1025,3 +1046,3 @@ url: url.href,

const exception = error;
if (exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' && typeof exception.url === 'string') {
if ((exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' || exception.code === 'ERR_MODULE_NOT_FOUND') && typeof exception.url === 'string') {
return exception.url;

@@ -1028,0 +1049,0 @@ }

{
"name": "@babel/core",
"version": "7.23.2",
"version": "7.23.7",
"description": "Babel compiler core.",

@@ -50,11 +50,11 @@ "main": "./lib/index.js",

"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.22.13",
"@babel/generator": "^7.23.0",
"@babel/helper-compilation-targets": "^7.22.15",
"@babel/helper-module-transforms": "^7.23.0",
"@babel/helpers": "^7.23.2",
"@babel/parser": "^7.23.0",
"@babel/code-frame": "^7.23.5",
"@babel/generator": "^7.23.6",
"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-module-transforms": "^7.23.3",
"@babel/helpers": "^7.23.7",
"@babel/parser": "^7.23.6",
"@babel/template": "^7.22.15",
"@babel/traverse": "^7.23.2",
"@babel/types": "^7.23.0",
"@babel/traverse": "^7.23.7",
"@babel/types": "^7.23.6",
"convert-source-map": "^2.0.0",

@@ -68,7 +68,7 @@ "debug": "^4.1.0",

"@babel/helper-transform-fixture-test-runner": "^7.22.19",
"@babel/plugin-syntax-flow": "^7.22.5",
"@babel/plugin-transform-flow-strip-types": "^7.22.5",
"@babel/plugin-transform-modules-commonjs": "^7.23.0",
"@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@babel/plugin-syntax-flow": "^7.23.3",
"@babel/plugin-transform-flow-strip-types": "^7.23.3",
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@babel/preset-env": "^7.23.7",
"@babel/preset-typescript": "^7.23.3",
"@jridgewell/trace-mapping": "^0.3.17",

@@ -75,0 +75,0 @@ "@types/convert-source-map": "^2.0.0",

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

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