1. babel-plugin-transform-object-set-prototype-of-to-assign
Turn Object.setPrototypeOf to assignments
babel-plugin-transform-object-set-prototype-of-to-assign
Package: babel-plugin-transform-object-set-prototype-of-to-assign
Created by: babel
Last modified: Mon, 13 Jun 2022 04:05:00 GMT
Version: 6.22.0
License: MIT
Downloads: 1,059
Repository: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-set-prototype-of-to-assign

Install

npm install babel-plugin-transform-object-set-prototype-of-to-assign
yarn add babel-plugin-transform-object-set-prototype-of-to-assign

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

Example

In

 Object.setPrototypeOf(bar, foo);

Out

 var _defaults = ...;

_defaults(bar, foo);

Installation

 $ npm install 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"]
});

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code