Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@babel/plugin-transform-property-literals
Advanced tools
Ensure that reserved words are quoted in object property keys
The @babel/plugin-transform-property-literals package is a Babel plugin that transforms object properties to use literals when they are valid identifiers. This transformation can help improve code readability and potentially optimize execution by leveraging engine optimizations for property access.
Transforming Reserved Word Properties
Transforms reserved word properties into literal properties if they are valid identifiers, ensuring compatibility and potentially improving execution speed.
{"var": "value"} // Before transformation
{"var": "value"} // After transformation
Transforming Numeric Properties
Automatically transforms numeric properties into their literal form, enhancing code readability and leveraging engine optimizations.
{"123": "value"} // Before transformation
{123: "value"} // After transformation
This plugin transforms reserved words into a form that can be safely used as property keys. It is similar to @babel/plugin-transform-property-literals but focuses more on reserved words in JavaScript.
Transforms property mutators to use a more compatible syntax. While it deals with properties, its focus is more on the mutation aspect rather than transforming property keys into literals.
Ensure that reserved words are quoted in object property keys
See our website @babel/plugin-transform-property-literals for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-property-literals
or using yarn:
yarn add @babel/plugin-transform-property-literals --dev
v7.25.9 (2024-10-22)
babel-parser
, babel-template
, babel-types
syntacticPlaceholders
mode (@liuxingbaoyu)babel-helper-compilation-targets
, babel-preset-env
ClassAccessorProperty
to prevent the no-undef
rule (@victorenator)babel-parser
, babel-types
VISITOR_KEYS
etc. faster to access (@liuxingbaoyu)FAQs
Ensure that reserved words are quoted in object property keys
The npm package @babel/plugin-transform-property-literals receives a total of 15,265,607 weekly downloads. As such, @babel/plugin-transform-property-literals popularity was classified as popular.
We found that @babel/plugin-transform-property-literals 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.