Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-duplicate-keys

Package Overview
Dependencies
54
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

@babel/plugin-transform-duplicate-keys

Compile objects with duplicate keys to valid strict ES5

    7.23.3latest
    GitHub
    npm

Version published
Maintainers
4
Weekly downloads
22,685,421
increased by3.92%

Weekly downloads

Package description

What is @babel/plugin-transform-duplicate-keys?

The @babel/plugin-transform-duplicate-keys npm package is designed to help developers manage object literals in JavaScript that have duplicate keys. When using this plugin, Babel will transform object literals containing duplicate keys by ensuring that the last key-value pair is the one that is ultimately defined, following the standard JavaScript behavior. This can be particularly useful in scenarios where code is being generated or transformed and duplicate keys may be introduced unintentionally.

What are @babel/plugin-transform-duplicate-keys's main functionalities?

Transforming Duplicate Keys in Object Literals

This feature allows the transformation of object literals with duplicate keys in JavaScript code. The plugin ensures that if an object literal contains duplicate keys, only the last occurrence of the key is kept, and previous ones are ignored. This aligns with the standard JavaScript behavior where the last property assignment overrides earlier assignments with the same key.

{"type": "object", "properties": {"duplicateKey": {"type": "string"}, "duplicateKey": {"type": "number"}}}

Other packages similar to @babel/plugin-transform-duplicate-keys

Changelog

Source

v7.23.3 (2023-11-09)

:bug: Bug Fix
  • babel-plugin-transform-typescript
    • #16071 Strip type-only TS namespaces (@colinaaa)
  • babel-generator
  • babel-compat-data, babel-plugin-bugfix-v8-static-class-fields-redefine-readonly, babel-preset-env
  • babel-plugin-transform-object-super
  • babel-helper-module-transforms, babel-plugin-transform-modules-amd, babel-plugin-transform-modules-commonjs, babel-plugin-transform-modules-umd
:memo: Documentation
  • #16044 docs: Update links in @babel/eslint-parser README (@aryehb)
:house: Internal
  • babel-core, babel-preset-env
:running_woman: Performance
:microscope: Output optimization
  • babel-plugin-transform-computed-properties

Readme

Source

@babel/plugin-transform-duplicate-keys

Compile objects with duplicate keys to valid strict ES5

See our website @babel/plugin-transform-duplicate-keys for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-transform-duplicate-keys

or using yarn:

yarn add @babel/plugin-transform-duplicate-keys --dev

Keywords

FAQs

Last updated on 09 Nov 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the 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