Socket
Socket
Sign inDemoInstall

babel-plugin-transform-object-assign

Package Overview
Dependencies
3
Maintainers
6
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-transform-object-assign

Replace Object.assign with an inline helper


Version published
Weekly downloads
94K
decreased by-1.15%
Maintainers
6
Install size
2.23 MB
Created
Weekly downloads
 

Readme

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": ["transform-object-assign"]
}

Via CLI

babel --plugins transform-object-assign script.js

Via Node API

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

Keywords

FAQs

Last updated on 20 Jan 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc