@babel/plugin-transform-shorthand-properties
Advanced tools
Comparing version 7.21.4-esm.3 to 7.21.4-esm.4
@@ -1,10 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
var _core = require("@babel/core"); | ||
var _default = (0, _helperPluginUtils.declare)(api => { | ||
import { declare } from "@babel/helper-plugin-utils"; | ||
import { types as t } from "@babel/core"; | ||
export default declare(api => { | ||
api.assertVersion(7); | ||
@@ -19,11 +13,11 @@ return { | ||
if (node.kind === "method") { | ||
const func = _core.types.functionExpression(null, node.params, node.body, node.generator, node.async); | ||
const func = t.functionExpression(null, node.params, node.body, node.generator, node.async); | ||
func.returnType = node.returnType; | ||
const computedKey = _core.types.toComputedKey(node); | ||
if (_core.types.isStringLiteral(computedKey, { | ||
const computedKey = t.toComputedKey(node); | ||
if (t.isStringLiteral(computedKey, { | ||
value: "__proto__" | ||
})) { | ||
path.replaceWith(_core.types.objectProperty(computedKey, func, true)); | ||
path.replaceWith(t.objectProperty(computedKey, func, true)); | ||
} else { | ||
path.replaceWith(_core.types.objectProperty(node.key, func, node.computed)); | ||
path.replaceWith(t.objectProperty(node.key, func, node.computed)); | ||
} | ||
@@ -37,7 +31,7 @@ } | ||
if (node.shorthand) { | ||
const computedKey = _core.types.toComputedKey(node); | ||
if (_core.types.isStringLiteral(computedKey, { | ||
const computedKey = t.toComputedKey(node); | ||
if (t.isStringLiteral(computedKey, { | ||
value: "__proto__" | ||
})) { | ||
path.replaceWith(_core.types.objectProperty(computedKey, node.value, true)); | ||
path.replaceWith(t.objectProperty(computedKey, node.value, true)); | ||
} else { | ||
@@ -51,4 +45,3 @@ node.shorthand = false; | ||
}); | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/plugin-transform-shorthand-properties", | ||
"version": "7.21.4-esm.3", | ||
"version": "7.21.4-esm.4", | ||
"description": "Compile ES2015 shorthand properties to ES5", | ||
@@ -20,3 +20,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "7.21.4-esm.3" | ||
"@babel/helper-plugin-utils": "7.21.4-esm.4" | ||
}, | ||
@@ -27,4 +27,4 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@babel/core": "7.21.4-esm.3", | ||
"@babel/helper-plugin-test-runner": "7.21.4-esm.3" | ||
"@babel/core": "7.21.4-esm.4", | ||
"@babel/helper-plugin-test-runner": "7.21.4-esm.4" | ||
}, | ||
@@ -31,0 +31,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
6813
43
+ Added@babel/helper-plugin-utils@7.21.4-esm.4(transitive)
- Removed@babel/helper-plugin-utils@7.21.4-esm.3(transitive)