Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@babel/plugin-syntax-logical-assignment-operators
Advanced tools
Allow parsing of the logical assignment operators
The @babel/plugin-syntax-logical-assignment-operators package allows Babel to parse code that uses logical assignment operators. These operators combine logical operations with assignment expressions. This plugin only enables the syntax, and does not transform it. To transform the code, you would need to use another plugin or set of plugins that handle the transformation.
Logical AND Assignment (&&=)
The logical AND assignment (&&=) operator only assigns the value of the right operand to the left operand if the left operand is truthy.
a &&= b;
Logical OR Assignment (||=)
The logical OR assignment (||=) operator assigns the value of the right operand to the left operand if the left operand is falsy.
a ||= b;
Logical Nullish Assignment (??=)
The logical nullish assignment (??=) operator assigns the value of the right operand to the left operand if the left operand is null or undefined.
a ??= b;
This package is a proposal plugin that not only allows Babel to parse logical assignment operators but also transforms them. It is similar to @babel/plugin-syntax-logical-assignment-operators but includes the transformation step.
While not exclusively focused on logical assignment operators, @babel/preset-env includes the necessary plugins to both parse and transform modern JavaScript syntax, including logical assignment operators, based on the target environment.
Allow parsing of the logical assignment operators.
npm install --save-dev @babel/plugin-syntax-logical-assignment-operators
.babelrc
(Recommended).babelrc
{
"plugins": ["@babel/plugin-syntax-logical-assignment-operators"]
}
babel --plugins @babel/plugin-syntax-logical-assignment-operators script.js
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-syntax-logical-assignment-operators"]
});
FAQs
Allow parsing of the logical assignment operators
We found that @babel/plugin-syntax-logical-assignment-operators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.