@babel/plugin-transform-shorthand-properties
Advanced tools
Comparing version 7.12.1 to 7.12.13
@@ -26,11 +26,30 @@ "use strict"; | ||
func.returnType = node.returnType; | ||
path.replaceWith(_core.types.objectProperty(node.key, func, node.computed)); | ||
const computedKey = _core.types.toComputedKey(node); | ||
if (_core.types.isStringLiteral(computedKey, { | ||
value: "__proto__" | ||
})) { | ||
path.replaceWith(_core.types.objectProperty(computedKey, func, true)); | ||
} else { | ||
path.replaceWith(_core.types.objectProperty(node.key, func, node.computed)); | ||
} | ||
} | ||
}, | ||
ObjectProperty({ | ||
node | ||
}) { | ||
ObjectProperty(path) { | ||
const { | ||
node | ||
} = path; | ||
if (node.shorthand) { | ||
node.shorthand = false; | ||
const computedKey = _core.types.toComputedKey(node); | ||
if (_core.types.isStringLiteral(computedKey, { | ||
value: "__proto__" | ||
})) { | ||
path.replaceWith(_core.types.objectProperty(computedKey, node.value, true)); | ||
} else { | ||
node.shorthand = false; | ||
} | ||
} | ||
@@ -37,0 +56,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-shorthand-properties", | ||
"version": "7.12.1", | ||
"version": "7.12.13", | ||
"description": "Compile ES2015 shorthand properties to ES5", | ||
@@ -10,2 +10,3 @@ "repository": { | ||
}, | ||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-shorthand-properties", | ||
"license": "MIT", | ||
@@ -20,3 +21,3 @@ "publishConfig": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.10.4" | ||
"@babel/helper-plugin-utils": "^7.12.13" | ||
}, | ||
@@ -27,5 +28,5 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@babel/core": "^7.12.1", | ||
"@babel/helper-plugin-test-runner": "7.10.4" | ||
"@babel/core": "7.12.13", | ||
"@babel/helper-plugin-test-runner": "7.12.13" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # @babel/plugin-transform-shorthand-properties | ||
See our website [@babel/plugin-transform-shorthand-properties](https://babeljs.io/docs/en/next/babel-plugin-transform-shorthand-properties.html) for more information. | ||
See our website [@babel/plugin-transform-shorthand-properties](https://babeljs.io/docs/en/babel-plugin-transform-shorthand-properties) for more information. | ||
@@ -8,0 +8,0 @@ ## Install |
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
3841
47
0