Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/plugin-proposal-logical-assignment-operators

Package Overview
Dependencies
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-logical-assignment-operators - npm Package Compare versions

Comparing version 7.21.4-esm to 7.21.4-esm.1

29

lib/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc