Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-runtime

Package Overview
Dependencies
6
Maintainers
4
Versions
136
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.21.4-esm.3 to 7.21.4-esm.4

lib/package.json

11

lib/get-runtime-path/browser.js

@@ -1,13 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
exports.resolveFSPath = resolveFSPath;
function _default(moduleName, dirname, absoluteRuntime) {
export default function (moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
resolveFSPath();
}
function resolveFSPath() {
export function resolveFSPath() {
throw new Error("The 'absoluteRuntime' option is not supported when using @babel/standalone.");

@@ -14,0 +7,0 @@ }

@@ -1,17 +0,11 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
exports.resolveFSPath = resolveFSPath;
var _path = require("path");
var _module = require("module");
function _default(moduleName, dirname, absoluteRuntime) {
import path from "path";
import { createRequire } from "module";
const require = createRequire(import.meta.url);
export default function (moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
return resolveAbsoluteRuntime(moduleName, _path.resolve(dirname, absoluteRuntime === true ? "." : absoluteRuntime));
return resolveAbsoluteRuntime(moduleName, path.resolve(dirname, absoluteRuntime === true ? "." : absoluteRuntime));
}
function resolveAbsoluteRuntime(moduleName, dirname) {
try {
return _path.dirname((((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
return path.dirname((((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
paths: [b]

@@ -36,3 +30,3 @@ }, M = require("module")) => {

}
function resolveFSPath(path) {
export function resolveFSPath(path) {
return require.resolve(path).replace(/\\/g, "/");

@@ -39,0 +33,0 @@ }

@@ -1,14 +0,8 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasMinVersion = hasMinVersion;
var _semver = require("semver");
function hasMinVersion(minVersion, runtimeVersion) {
import semver from "semver";
export function hasMinVersion(minVersion, runtimeVersion) {
if (!runtimeVersion) return true;
if (_semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;
return !_semver.intersects(`<${minVersion}`, runtimeVersion) && !_semver.intersects(`>=8.0.0`, runtimeVersion);
if (semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;
return !semver.intersects(`<${minVersion}`, runtimeVersion) && !semver.intersects(`>=8.0.0`, runtimeVersion);
}
//# sourceMappingURL=helpers.js.map

@@ -1,18 +0,12 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperModuleImports = require("@babel/helper-module-imports");
var _core = require("@babel/core");
var _helpers = require("./helpers");
var _getRuntimePath = require("./get-runtime-path");
var _babelPluginPolyfillCorejs = require("babel-plugin-polyfill-corejs2");
var _babelPluginPolyfillCorejs2 = require("babel-plugin-polyfill-corejs3");
var _babelPluginPolyfillRegenerator = require("babel-plugin-polyfill-regenerator");
const pluginCorejs2 = _babelPluginPolyfillCorejs.default || _babelPluginPolyfillCorejs;
const pluginCorejs3 = _babelPluginPolyfillCorejs2.default || _babelPluginPolyfillCorejs2;
const pluginRegenerator = _babelPluginPolyfillRegenerator.default || _babelPluginPolyfillRegenerator;
import { declare } from "@babel/helper-plugin-utils";
import { addDefault, isModule } from "@babel/helper-module-imports";
import { types as t } from "@babel/core";
import { hasMinVersion } from "./helpers.js";
import getRuntimePath, { resolveFSPath } from "./get-runtime-path/index.js";
import _pluginCorejs2 from "babel-plugin-polyfill-corejs2";
import _pluginCorejs3 from "babel-plugin-polyfill-corejs3";
import _pluginRegenerator from "babel-plugin-polyfill-regenerator";
const pluginCorejs2 = _pluginCorejs2.default || _pluginCorejs2;
const pluginCorejs3 = _pluginCorejs3.default || _pluginCorejs3;
const pluginRegenerator = _pluginRegenerator.default || _pluginRegenerator;
const pluginsCompat = "#__secret_key__@babel/runtime__compatibility";

@@ -22,3 +16,3 @@ function supportsStaticESM(caller) {

}
var _default = (0, _helperPluginUtils.declare)((api, options, dirname) => {
export default declare((api, options, dirname) => {
api.assertVersion(7);

@@ -65,3 +59,3 @@ const {

const DUAL_MODE_RUNTIME = "7.13.0";
var supportsCJSDefault = (0, _helpers.hasMinVersion)(DUAL_MODE_RUNTIME, runtimeVersion);
var supportsCJSDefault = hasMinVersion(DUAL_MODE_RUNTIME, runtimeVersion);
}

@@ -93,3 +87,3 @@ function has(obj, key) {

const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
const modulePath = (0, _getRuntimePath.default)(moduleName, dirname, absoluteRuntime);
const modulePath = getRuntimePath(moduleName, dirname, absoluteRuntime);
function createCorejsPlugin(plugin, options, regeneratorPlugin) {

@@ -152,3 +146,3 @@ return (api, _, filename) => {

if (name === "regeneratorRuntime") {
return _core.types.arrowFunctionExpression([], _core.types.identifier("regeneratorRuntime"));
return t.arrowFunctionExpression([], t.identifier("regeneratorRuntime"));
}

@@ -159,6 +153,6 @@ return;

const isInteropHelper = HEADER_HELPERS.indexOf(name) !== -1;
const blockHoist = isInteropHelper && !(0, _helperModuleImports.isModule)(file.path) ? 4 : undefined;
const blockHoist = isInteropHelper && !isModule(file.path) ? 4 : undefined;
const helpersDir = esModules && file.path.node.sourceType === "module" ? "helpers/esm" : "helpers";
let helperPath = `${modulePath}/${helpersDir}/${name}`;
if (absoluteRuntime) helperPath = (0, _getRuntimePath.resolveFSPath)(helperPath);
if (absoluteRuntime) helperPath = resolveFSPath(helperPath);
return addDefaultImport(helperPath, name, blockHoist, true);

@@ -168,9 +162,9 @@ });

function addDefaultImport(source, nameHint, blockHoist, isHelper = false) {
const cacheKey = (0, _helperModuleImports.isModule)(file.path);
const cacheKey = isModule(file.path);
const key = `${source}:${nameHint}:${cacheKey || ""}`;
let cached = cache.get(key);
if (cached) {
cached = _core.types.cloneNode(cached);
cached = t.cloneNode(cached);
} else {
cached = (0, _helperModuleImports.addDefault)(file.path, source, {
cached = addDefault(file.path, source, {
importedInterop: isHelper && supportsCJSDefault ? "compiled" : "uncompiled",

@@ -187,4 +181,3 @@ nameHint,

});
exports.default = _default;
//# sourceMappingURL=index.js.map
{
"name": "@babel/plugin-transform-runtime",
"version": "7.21.4-esm.3",
"version": "7.21.4-esm.4",
"description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals",

@@ -23,4 +23,4 @@ "repository": {

"dependencies": {
"@babel/helper-module-imports": "7.21.4-esm.3",
"@babel/helper-plugin-utils": "7.21.4-esm.3",
"@babel/helper-module-imports": "7.21.4-esm.4",
"@babel/helper-plugin-utils": "7.21.4-esm.4",
"babel-plugin-polyfill-corejs2": "^0.3.3",

@@ -35,10 +35,10 @@ "babel-plugin-polyfill-corejs3": "^0.6.0",

"devDependencies": {
"@babel/core": "7.21.4-esm.3",
"@babel/helper-plugin-test-runner": "7.21.4-esm.3",
"@babel/helpers": "7.21.4-esm.3",
"@babel/preset-env": "7.21.4-esm.3",
"@babel/runtime": "7.21.4-esm.3",
"@babel/runtime-corejs3": "7.21.4-esm.3",
"@babel/template": "7.21.4-esm.3",
"@babel/types": "7.21.4-esm.3",
"@babel/core": "7.21.4-esm.4",
"@babel/helper-plugin-test-runner": "7.21.4-esm.4",
"@babel/helpers": "7.21.4-esm.4",
"@babel/preset-env": "7.21.4-esm.4",
"@babel/runtime": "7.21.4-esm.4",
"@babel/runtime-corejs3": "7.21.4-esm.4",
"@babel/template": "7.21.4-esm.4",
"@babel/types": "7.21.4-esm.4",
"make-dir": "^2.1.0"

@@ -45,0 +45,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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc