Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
55
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Transforms logical assignment operators into short-circuited assignments


Version published
Weekly downloads
8M
increased by2.32%
Maintainers
4
Install size
22.6 kB
Created
Weekly downloads
 

Package description

What is @babel/plugin-proposal-logical-assignment-operators?

The @babel/plugin-proposal-logical-assignment-operators package allows Babel to compile logical assignment operators into ES5 or your target environment's JavaScript. Logical assignment operators combine logical operations with assignment expressions, enabling more concise and expressive code.

What are @babel/plugin-proposal-logical-assignment-operators's main functionalities?

Logical AND assignment (&&=)

This feature allows the assignment of the right operand to the left operand only if the left operand is truthy. It's equivalent to `a = a && b;`.

a &&= b;

Logical OR assignment (||=)

This feature enables the assignment of the right operand to the left operand if the left operand is falsy. It simplifies the expression `a = a || b;`.

a ||= b;

Logical nullish assignment (??=)

This feature assigns the right operand to the left operand only if the left operand is null or undefined, making the code `a = a ?? b;` more concise.

a ??= b;

Other packages similar to @babel/plugin-proposal-logical-assignment-operators

Changelog

Source

v7.20.7 (2022-12-22)

:eyeglasses: Spec Compliance
  • babel-helper-member-expression-to-functions, babel-helper-replace-supers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes
    • #15223 fix: Deleting super property should throw (@SuperSodaSea)
  • babel-helpers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes, babel-plugin-transform-object-super
:bug: Bug Fix
  • babel-parser, babel-plugin-transform-typescript
  • babel-traverse
  • babel-plugin-transform-typescript, babel-traverse
  • babel-plugin-transform-block-scoping
  • babel-plugin-proposal-async-generator-functions, babel-preset-env
  • babel-generator, babel-plugin-proposal-optional-chaining
  • babel-plugin-transform-react-jsx, babel-types
  • babel-core, babel-helpers, babel-plugin-transform-computed-properties, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-helper-member-expression-to-functions, babel-helper-replace-supers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes
  • babel-generator
:nail_care: Polish
  • babel-plugin-transform-block-scoping, babel-traverse
:house: Internal
  • babel-helper-define-map, babel-plugin-transform-property-mutators
  • babel-core, babel-plugin-proposal-class-properties, babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-plugin-transform-destructuring, babel-plugin-transform-parameters, babel-plugin-transform-regenerator, babel-plugin-transform-runtime, babel-preset-env, babel-traverse
:running_woman: Performance

Readme

Source

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

Transforms logical assignment operators into short-circuited assignments

See our website @babel/plugin-proposal-logical-assignment-operators for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-logical-assignment-operators

or using yarn:

yarn add @babel/plugin-proposal-logical-assignment-operators --dev

Keywords

FAQs

Last updated on 22 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc