Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-runtime

Package Overview
Dependencies
Maintainers
6
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-runtime - npm Package Compare versions

Comparing version 7.16.0 to 7.16.4

5

lib/get-runtime-path/browser.js

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

exports.default = _default;
exports.resolveFSPath = resolveFSPath;
function _default(moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
resolveFSPath();
}
function resolveFSPath() {
throw new Error("The 'absoluteRuntime' option is not supported when using @babel/standalone.");
}

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

exports.default = _default;
exports.resolveFSPath = resolveFSPath;

@@ -40,2 +41,6 @@ var _path = require("path");

}
}
function resolveFSPath(path) {
return require.resolve(path);
}

14

lib/index.js

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

const corejsExt = absoluteRuntime ? ".js" : "";
return {

@@ -138,9 +137,11 @@ name: "transform-runtime",

method: "usage-pure",
absoluteImports: absoluteRuntime ? modulePath : false,
[pluginsCompat]: {
runtimeVersion,
useBabelRuntime: modulePath,
ext: corejsExt
ext: ""
}
}, createRegeneratorPlugin({
method: "usage-pure",
absoluteImports: absoluteRuntime ? modulePath : false,
[pluginsCompat]: {

@@ -153,8 +154,10 @@ useBabelRuntime: modulePath

proposals,
absoluteImports: absoluteRuntime ? modulePath : false,
[pluginsCompat]: {
useBabelRuntime: modulePath,
ext: corejsExt
ext: ""
}
}, createRegeneratorPlugin({
method: "usage-pure",
absoluteImports: absoluteRuntime ? modulePath : false,
[pluginsCompat]: {

@@ -165,2 +168,3 @@ useBabelRuntime: modulePath

method: "usage-pure",
absoluteImports: absoluteRuntime ? modulePath : false,
[pluginsCompat]: {

@@ -181,3 +185,5 @@ useBabelRuntime: modulePath

const helpersDir = esModules && file.path.node.sourceType === "module" ? "helpers/esm" : "helpers";
return addDefaultImport(`${modulePath}/${helpersDir}/${name}`, name, blockHoist, true);
let helperPath = `${modulePath}/${helpersDir}/${name}`;
if (absoluteRuntime) helperPath = (0, _getRuntimePath.resolveFSPath)(helperPath);
return addDefaultImport(helperPath, name, blockHoist, true);
});

@@ -184,0 +190,0 @@ const cache = new Map();

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

@@ -25,5 +25,5 @@ "repository": {

"@babel/helper-plugin-utils": "^7.14.5",
"babel-plugin-polyfill-corejs2": "^0.2.3",
"babel-plugin-polyfill-corejs3": "^0.3.0",
"babel-plugin-polyfill-regenerator": "^0.2.3",
"babel-plugin-polyfill-corejs2": "^0.3.0",
"babel-plugin-polyfill-corejs3": "^0.4.0",
"babel-plugin-polyfill-regenerator": "^0.3.0",
"semver": "^6.3.0"

@@ -37,7 +37,7 @@ },

"@babel/helper-plugin-test-runner": "^7.16.0",
"@babel/helpers": "^7.16.0",
"@babel/helpers": "^7.16.3",
"@babel/plugin-transform-typeof-symbol": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"@babel/runtime": "^7.16.0",
"@babel/runtime-corejs3": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"@babel/runtime": "^7.16.3",
"@babel/runtime-corejs3": "^7.16.3",
"@babel/template": "^7.16.0",

@@ -44,0 +44,0 @@ "@babel/types": "^7.16.0",

export default function (moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
resolveFSPath();
}
export function resolveFSPath() {
throw new Error(

@@ -5,0 +9,0 @@ "The 'absoluteRuntime' option is not supported when using @babel/standalone.",

@@ -35,1 +35,5 @@ import path from "path";

}
export function resolveFSPath(path) {
return require.resolve(path);
}
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