1.0.1 • Published 10 years ago
babel-plugin-object-set-prototype-of-to-assign v1.0.1
babel-plugin-object-set-prototype-of-to-assign
The object-set-prototype-of-to-assign plugin will transform all Object.setPrototypeOf calls to a method that will do a shallow defaults of all properties.
NOTE: There are some caveats when using this plugin, see the babel-plugin-proto-to-assign README for more information..
Example
In
Object.setPrototypeOf(bar, foo);Out
var _defaults = ...;
_defaults(bar, foo);Installation
$ npm install babel-plugin-object-set-prototype-of-to-assignUsage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["object-set-prototype-of-to-assign"]
}Via CLI
$ babel --plugins object-set-prototype-of-to-assign script.jsVia Node API
require("babel-core").transform("code", {
plugins: ["object-set-prototype-of-to-assign"]
});1.0.1
10 years ago