Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-runtime

Package Overview
Dependencies
82
Maintainers
4
Versions
136
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.24.0 to 7.24.1

21

lib/index.js

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

var _index = require("./get-runtime-path/index.js");
var _coreJs = require("./core-js.js");
var _index2 = require("./babel-7/index.cjs");
var _default = exports.default = (0, _helperPluginUtils.declare)((api, options, dirname) => {
var _options$corejs;
api.assertVersion(7);
const {
helpers: useRuntimeHelpers = true,
version: runtimeVersion = "7.0.0-beta.0",

@@ -24,5 +21,2 @@ absoluteRuntime = false,

} = options;
if (typeof useRuntimeHelpers !== "boolean") {
throw new Error("The 'helpers' option must be undefined, or a boolean.");
}
if (typeof absoluteRuntime !== "boolean" && typeof absoluteRuntime !== "string") {

@@ -65,6 +59,14 @@ throw new Error("The 'absoluteRuntime' option must be undefined, a boolean, or a string.");

}
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
{
var {
helpers: useRuntimeHelpers = true
} = options;
if (typeof useRuntimeHelpers !== "boolean") {
throw new Error("The 'helpers' option must be undefined, or a boolean.");
}
}
const HEADER_HELPERS = new Set(["interopRequireWildcard", "interopRequireDefault"]);
return {
name: "transform-runtime",
inherits: _index2.createPolyfillPlugins(options, runtimeVersion, absoluteRuntime, options.corejs === 3 || ((_options$corejs = options.corejs) == null ? void 0 : _options$corejs.version) === 3 ? (0, _coreJs.createCorejs3Plugin)(options.corejs, absoluteRuntime) : null),
inherits: _index2.createPolyfillPlugins(options, runtimeVersion, absoluteRuntime),
pre(file) {

@@ -84,4 +86,3 @@ if (!useRuntimeHelpers) return;

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

@@ -88,0 +89,0 @@ if (absoluteRuntime) helperPath = (0, _index.resolveFSPath)(helperPath);

{
"name": "@babel/plugin-transform-runtime",
"version": "7.24.0",
"version": "7.24.1",
"description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals",

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

"dependencies": {
"@babel/helper-module-imports": "^7.22.15",
"@babel/helper-module-imports": "^7.24.1",
"@babel/helper-plugin-utils": "^7.24.0",
"babel-plugin-polyfill-corejs2": "^0.4.8",
"babel-plugin-polyfill-corejs3": "^0.9.0",
"babel-plugin-polyfill-regenerator": "^0.5.5",
"babel-plugin-polyfill-corejs2": "^0.4.10",
"babel-plugin-polyfill-corejs3": "^0.10.1",
"babel-plugin-polyfill-regenerator": "^0.6.1",
"semver": "^6.3.1"

@@ -35,8 +35,9 @@ },

"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/helper-plugin-test-runner": "^7.22.5",
"@babel/helpers": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/runtime": "^7.24.0",
"@babel/runtime-corejs3": "^7.24.0",
"@babel/core": "^7.24.1",
"@babel/helper-plugin-test-runner": "^7.24.1",
"@babel/helpers": "^7.24.1",
"@babel/preset-env": "^7.24.1",
"@babel/runtime": "^7.24.1",
"@babel/runtime-corejs3": "^7.24.1",
"babel-plugin-polyfill-corejs3": "^0.10.1",
"make-dir": "^2.1.0"

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

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