@babel/plugin-transform-runtime
Advanced tools
Comparing version 7.23.9 to 7.24.0
@@ -20,3 +20,4 @@ "use strict"; | ||
version: runtimeVersion = "7.0.0-beta.0", | ||
absoluteRuntime = false | ||
absoluteRuntime = false, | ||
moduleName = null | ||
} = options; | ||
@@ -32,2 +33,5 @@ if (typeof useRuntimeHelpers !== "boolean") { | ||
} | ||
if (moduleName !== null && typeof moduleName !== "string") { | ||
throw new Error("The 'moduleName' option must be null or a string."); | ||
} | ||
{ | ||
@@ -37,6 +41,3 @@ const DUAL_MODE_RUNTIME = "7.13.0"; | ||
} | ||
function has(obj, key) { | ||
return Object.prototype.hasOwnProperty.call(obj, key); | ||
} | ||
if (has(options, "useBuiltIns")) { | ||
if (hasOwnProperty.call(options, "useBuiltIns")) { | ||
if (options["useBuiltIns"]) { | ||
@@ -48,3 +49,3 @@ throw new Error("The 'useBuiltIns' option has been removed. The @babel/runtime " + "module now uses builtins by default."); | ||
} | ||
if (has(options, "polyfill")) { | ||
if (hasOwnProperty.call(options, "polyfill")) { | ||
if (options["polyfill"] === false) { | ||
@@ -56,5 +57,2 @@ throw new Error("The 'polyfill' option has been removed. The @babel/runtime " + "module now skips polyfilling by default."); | ||
} | ||
if (has(options, "moduleName")) { | ||
throw new Error("The 'moduleName' option has been removed. @babel/transform-runtime " + "no longer supports arbitrary runtimes. If you were using this to " + "set an absolute path for Babel's standard runtimes, please use the " + "'absoluteRuntime' option."); | ||
} | ||
; | ||
@@ -78,4 +76,4 @@ { | ||
file.set("helperGenerator", name => { | ||
var _modulePath, _file$get; | ||
(_modulePath = modulePath) != null ? _modulePath : modulePath = (0, _index.default)((_file$get = file.get("runtimeHelpersModuleName")) != null ? _file$get : "@babel/runtime", dirname, absoluteRuntime); | ||
var _modulePath, _ref; | ||
(_modulePath = modulePath) != null ? _modulePath : modulePath = (0, _index.default)((_ref = moduleName != null ? moduleName : file.get("runtimeHelpersModuleName")) != null ? _ref : "@babel/runtime", dirname, absoluteRuntime); | ||
{ | ||
@@ -82,0 +80,0 @@ if (!(file.availableHelper != null && file.availableHelper(name, runtimeVersion))) { |
{ | ||
"name": "@babel/plugin-transform-runtime", | ||
"version": "7.23.9", | ||
"version": "7.24.0", | ||
"description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", | ||
@@ -24,3 +24,3 @@ "repository": { | ||
"@babel/helper-module-imports": "^7.22.15", | ||
"@babel/helper-plugin-utils": "^7.22.5", | ||
"@babel/helper-plugin-utils": "^7.24.0", | ||
"babel-plugin-polyfill-corejs2": "^0.4.8", | ||
@@ -35,8 +35,8 @@ "babel-plugin-polyfill-corejs3": "^0.9.0", | ||
"devDependencies": { | ||
"@babel/core": "^7.23.9", | ||
"@babel/core": "^7.24.0", | ||
"@babel/helper-plugin-test-runner": "^7.22.5", | ||
"@babel/helpers": "^7.23.9", | ||
"@babel/preset-env": "^7.23.9", | ||
"@babel/runtime": "^7.23.9", | ||
"@babel/runtime-corejs3": "^7.23.9", | ||
"@babel/helpers": "^7.24.0", | ||
"@babel/preset-env": "^7.24.0", | ||
"@babel/runtime": "^7.24.0", | ||
"@babel/runtime-corejs3": "^7.24.0", | ||
"make-dir": "^2.1.0" | ||
@@ -43,0 +43,0 @@ }, |
Sorry, the diff of this file is not supported yet
40919
305