
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@babel/plugin-transform-object-assign
Advanced tools
Replace
Object.assignwith an inline helper. If you are authoring an application, rather than a library, it is recommended that you use theObject.assignpolyfill instead.
In
Object.assign(a, b);
Out
var _extends = ...;
_extends(a, b);
Will only work with code of the form Object.assign or Object['assign']. The following patterns are not supported:
var { assign } = Object;
var assign = Object.assign;
npm install --save-dev @babel/plugin-transform-object-assign
.babelrc (Recommended).babelrc
{
"plugins": ["@babel/plugin-transform-object-assign"]
}
babel --plugins @babel/plugin-transform-object-assign script.js
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-object-assign"]
});
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.
FAQs
Replace Object.assign with an inline helper
The npm package @babel/plugin-transform-object-assign receives a total of 408,275 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.