@babel/plugin-proposal-logical-assignment-operators
Advanced tools
Comparing version 7.21.4-esm to 7.21.4-esm.1
@@ -1,15 +0,9 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
var _pluginSyntaxLogicalAssignmentOperators = require("@babel/plugin-syntax-logical-assignment-operators"); | ||
var _core = require("@babel/core"); | ||
var _default = (0, _helperPluginUtils.declare)(api => { | ||
import { declare } from "@babel/helper-plugin-utils"; | ||
import syntaxLogicalAssignmentOperators from "@babel/plugin-syntax-logical-assignment-operators"; | ||
import { types as t } from "@babel/core"; | ||
export default declare(api => { | ||
api.assertVersion(7); | ||
return { | ||
name: "proposal-logical-assignment-operators", | ||
inherits: _pluginSyntaxLogicalAssignmentOperators.default, | ||
inherits: syntaxLogicalAssignmentOperators.default, | ||
visitor: { | ||
@@ -27,7 +21,7 @@ AssignmentExpression(path) { | ||
const operatorTrunc = operator.slice(0, -1); | ||
if (!_core.types.LOGICAL_OPERATORS.includes(operatorTrunc)) { | ||
if (!t.LOGICAL_OPERATORS.includes(operatorTrunc)) { | ||
return; | ||
} | ||
const lhs = _core.types.cloneNode(left); | ||
if (_core.types.isMemberExpression(left)) { | ||
const lhs = t.cloneNode(left); | ||
if (t.isMemberExpression(left)) { | ||
const { | ||
@@ -41,3 +35,3 @@ object, | ||
left.object = memo; | ||
lhs.object = _core.types.assignmentExpression("=", _core.types.cloneNode(memo), object); | ||
lhs.object = t.assignmentExpression("=", t.cloneNode(memo), object); | ||
} | ||
@@ -48,7 +42,7 @@ if (computed) { | ||
left.property = memo; | ||
lhs.property = _core.types.assignmentExpression("=", _core.types.cloneNode(memo), property); | ||
lhs.property = t.assignmentExpression("=", t.cloneNode(memo), property); | ||
} | ||
} | ||
} | ||
path.replaceWith(_core.types.logicalExpression(operatorTrunc, lhs, _core.types.assignmentExpression("=", left, right))); | ||
path.replaceWith(t.logicalExpression(operatorTrunc, lhs, t.assignmentExpression("=", left, right))); | ||
} | ||
@@ -58,4 +52,3 @@ } | ||
}); | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/plugin-proposal-logical-assignment-operators", | ||
"version": "7.21.4-esm", | ||
"version": "7.21.4-esm.1", | ||
"description": "Transforms logical assignment operators into short-circuited assignments", | ||
@@ -19,12 +19,12 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.21.4-esm", | ||
"@babel/helper-plugin-utils": "^7.21.4-esm.1", | ||
"@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^7.0.0-0 || 7.21.4-esm" | ||
"@babel/core": "^7.0.0-0 || 7.21.4-esm.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.21.4-esm", | ||
"@babel/helper-plugin-test-runner": "^7.21.4-esm", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.21.4-esm", | ||
"@babel/core": "^7.21.4-esm.1", | ||
"@babel/helper-plugin-test-runner": "^7.21.4-esm.1", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.21.4-esm.1", | ||
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" | ||
@@ -37,3 +37,3 @@ }, | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "commonjs" | ||
"type": "module" | ||
} |
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
Yes
8342
49