Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-duplicate-keys

Package Overview
Dependencies
54
Maintainers
4
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-duplicate-keys

Compile objects with duplicate keys to valid strict ES5


Version published
Maintainers
4
Weekly downloads
22,013,591
decreased by-1.37%
Bundle size
1.2 kB
Minified + gzipped

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.18.9 (2022-07-18)

:bug: Bug Fix
  • babel-plugin-transform-modules-systemjs, babel-types
    • #14763 fix: allow exporting TSDeclareFunction as default (@zxbodya)
  • babel-generator
:nail_care: Polish
:house: Internal
  • babel-core, babel-helper-remap-async-to-generator, babel-helpers, babel-parser, babel-plugin-transform-block-scoping, babel-preset-env
  • babel-helper-create-class-features-plugin, babel-helper-member-expression-to-functions, babel-helper-remap-async-to-generator, babel-helper-replace-supers, babel-helper-wrap-function, babel-helpers, babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining, babel-plugin-proposal-decorators, babel-plugin-proposal-object-rest-spread, babel-plugin-proposal-optional-chaining, babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-traverse, babel-types
:running_woman: Performance

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 18 Jul 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