🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@babel/plugin-transform-object-assign

Package Overview
Dependencies
Maintainers
4
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-object-assign

Replace Object.assign with an inline helper

Source
npmnpm
Version
7.0.0-beta.33
Version published
Weekly downloads
565K
55.06%
Maintainers
4
Weekly downloads
 
Created
Source

@babel/plugin-transform-object-assign

Replace Object.assign with an inline helper. If you are authoring an application, rather than a library, it is recommended that you use the Object.assign polyfill instead.

Example

In

Object.assign(a, b);

Out

var _extends = ...;

_extends(a, b);

Caveats

  • 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;
    

Installation

npm install --save-dev @babel/plugin-transform-object-assign

Usage

.babelrc

{
  "plugins": ["@babel/plugin-transform-object-assign"]
}

Via CLI

babel --plugins @babel/plugin-transform-object-assign script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["@babel/plugin-transform-object-assign"]
});

Keywords

babel-plugin

FAQs

Package last updated on 01 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts