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

NOTE: There are some caveats when using this plugin, see the @babel/plugin-transform-proto-to-assign docs for more information.

Example

In

  1. Object.setPrototypeOf(bar, foo);

Out

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

Installation

  1. npm install --save-dev @babel/plugin-transform-object-set-prototype-of-to-assign

Usage

  1. {
  2. "plugins": ["@babel/plugin-transform-object-set-prototype-of-to-assign"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-transform-object-set-prototype-of-to-assign script.js

Via Node API

  1. require("@babel/core").transformSync("code", {
  2. plugins: ["@babel/plugin-transform-object-set-prototype-of-to-assign"],
  3. });