babel-plugin-transform-object-set-prototype-of-to-assign

6.22.0 • Public • Published

babel-plugin-transform-object-set-prototype-of-to-assign

This 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-transform-proto-to-assign README for more information..

Example

In

Object.setPrototypeOf(bar, foo);

Out

var _defaults = ...;
 
_defaults(bar, foo);

Installation

npm install --save-dev babel-plugin-transform-object-set-prototype-of-to-assign

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-object-set-prototype-of-to-assign"]
}

Via CLI

babel --plugins transform-object-set-prototype-of-to-assign script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-object-set-prototype-of-to-assign"]
});

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-transform-object-set-prototype-of-to-assign

Weekly Downloads

195

Version

6.22.0

License

MIT

Last publish

Collaborators

  • hzoo
  • loganfsmyth
  • existentialism