|
4 years ago | |
---|---|---|
.. | ||
lib | 4 years ago | |
.npmignore | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
package.json | 4 years ago |
Replace
Object.assign
with an inline helper. If you are authoring an application, rather than a library, it is recommended that you use theObject.assign
polyfill 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": ["transform-object-assign"]
}
babel --plugins transform-object-assign script.js
require("babel-core").transform("code", {
plugins: ["transform-object-assign"]
});