Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@babel/plugin-transform-object-assign
Advanced tools
@babel/plugin-transform-object-assign is a Babel plugin that transforms ES6 Object.assign() calls into a more compatible form for older environments that do not support Object.assign(). This is particularly useful for ensuring code compatibility across different JavaScript environments.
Transform Object.assign()
This feature transforms the ES6 Object.assign() method into a compatible form for older JavaScript environments. The code sample demonstrates how Object.assign() is used to merge properties from a source object into a target object.
const target = { a: 1 };
const source = { b: 2 };
const result = Object.assign(target, source);
console.log(result); // { a: 1, b: 2 }
core-js is a modular standard library for JavaScript that includes polyfills for many ECMAScript features, including Object.assign(). It provides a more comprehensive solution compared to @babel/plugin-transform-object-assign, as it covers a wider range of polyfills.
lodash.assign is a method from the Lodash library that performs a similar function to Object.assign(). It is part of the larger Lodash utility library, which offers a wide range of utility functions for JavaScript. Unlike @babel/plugin-transform-object-assign, lodash.assign is not a Babel plugin but a standalone utility function.
object-assign is a standalone npm package that provides a polyfill for Object.assign(). It is a lightweight alternative to @babel/plugin-transform-object-assign and is useful for projects that need a simple polyfill without the overhead of a full Babel plugin.
Replace Object.assign with an inline helper
See our website @babel/plugin-transform-object-assign for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-object-assign
or using yarn:
yarn add @babel/plugin-transform-object-assign --dev
v7.24.6 (2024-05-24)
babel-helper-create-class-features-plugin
, babel-plugin-transform-class-properties
babel-core
, babel-generator
, babel-plugin-transform-modules-commonjs
babel-helper-create-class-features-plugin
, babel-plugin-proposal-decorators
babel-helpers
, babel-plugin-proposal-decorators
, babel-runtime-corejs3
babel-parser
, babel-plugin-transform-typescript
cls.fn<C> = x
(@liuxingbaoyu)babel-core
, babel-helpers
, babel-plugin-transform-runtime
, babel-preset-env
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
babel-helpers
tsconfig.json
for @babel/helpers/src/helpers
(@nicolo-ribaudo)babel-cli
, babel-helpers
, babel-plugin-external-helpers
, babel-plugin-proposal-decorators
, babel-plugin-transform-class-properties
, babel-plugin-transform-modules-commonjs
, babel-plugin-transform-modules-systemjs
, babel-plugin-transform-runtime
, babel-preset-env
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
babel-parser
, babel-traverse
FAQs
Replace Object.assign with an inline helper
The npm package @babel/plugin-transform-object-assign receives a total of 816,031 weekly downloads. As such, @babel/plugin-transform-object-assign popularity was classified as popular.
We found that @babel/plugin-transform-object-assign 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.