Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@babel/plugin-transform-computed-properties
Advanced tools
Compile ES2015 computed properties to ES5
The @babel/plugin-transform-computed-properties npm package is a plugin for Babel that transforms computed property names in objects. This allows you to use expressions to define property names in your objects, which are evaluated at runtime.
Computed Property Names
This feature allows you to use expressions inside square brackets to compute property names for objects. The expression inside the brackets is evaluated and the result is used as the property name.
{"var obj = {['foo' + bar]: 'baz'};"}
This plugin allows Babel to transform the spread operator in arrays and function calls. While it does not directly relate to computed properties, it is another example of a Babel plugin that transforms modern JavaScript syntax into a form compatible with older environments.
Similar to the spread transform plugin, this one is for transforming object rest and spread properties. It does not handle computed properties, but it is related in the sense that it deals with object property manipulation.
This plugin transforms destructuring assignments and rest properties for more consistent code. It does not provide the same functionality as the computed properties plugin but is another tool for handling object properties.
Compile ES2015 computed properties to ES5
See our website @babel/plugin-transform-computed-properties for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-computed-properties
or using yarn:
yarn add @babel/plugin-transform-computed-properties --dev
FAQs
Compile ES2015 computed properties to ES5
We found that @babel/plugin-transform-computed-properties demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.