@babel/plugin-transform-proto-to-assign
Advanced tools
Comparing version 7.18.0 to 7.18.6
@@ -16,3 +16,3 @@ "use strict"; | ||
function isProtoKey(node) { | ||
return _core.types.isLiteral(_core.types.toComputedKey(node, node.key), { | ||
return !_core.types.isSpreadElement(node) && _core.types.isStringLiteral(_core.types.toComputedKey(node, node.key), { | ||
value: "__proto__" | ||
@@ -24,3 +24,3 @@ }); | ||
const left = node; | ||
return _core.types.isMemberExpression(left) && _core.types.isLiteral(_core.types.toComputedKey(left, left.property), { | ||
return _core.types.isMemberExpression(left) && _core.types.isStringLiteral(_core.types.toComputedKey(left, left.property), { | ||
value: "__proto__" | ||
@@ -37,3 +37,5 @@ }); | ||
visitor: { | ||
AssignmentExpression(path, file) { | ||
AssignmentExpression(path, { | ||
file | ||
}) { | ||
if (!isProtoAssignmentExpression(path.node.left)) return; | ||
@@ -53,3 +55,5 @@ const nodes = []; | ||
ExpressionStatement(path, file) { | ||
ExpressionStatement(path, { | ||
file | ||
}) { | ||
const expr = path.node.expression; | ||
@@ -65,3 +69,5 @@ if (!_core.types.isAssignmentExpression(expr, { | ||
ObjectExpression(path, file) { | ||
ObjectExpression(path, { | ||
file | ||
}) { | ||
let proto; | ||
@@ -68,0 +74,0 @@ const { |
{ | ||
"name": "@babel/plugin-transform-proto-to-assign", | ||
"version": "7.18.0", | ||
"version": "7.18.6", | ||
"description": "Babel plugin for turning __proto__ into a shallow property clone", | ||
@@ -20,3 +20,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.17.12" | ||
"@babel/helper-plugin-utils": "^7.18.6" | ||
}, | ||
@@ -27,4 +27,4 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@babel/core": "^7.18.0", | ||
"@babel/helper-plugin-test-runner": "^7.16.7" | ||
"@babel/core": "^7.18.6", | ||
"@babel/helper-plugin-test-runner": "^7.18.6" | ||
}, | ||
@@ -34,3 +34,4 @@ "engines": { | ||
}, | ||
"author": "The Babel Team (https://babel.dev/team)" | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "commonjs" | ||
} |
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
5088
78