Socket
Socket
Sign inDemoInstall

babel-plugin-transform-inline-consecutive-adds

Package Overview
Dependencies
0
Maintainers
6
Versions
80
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-transform-inline-consecutive-adds

This plugin inlines consecutive property assignments, array pushes, etc.


Version published
Weekly downloads
433K
increased by3.37%
Maintainers
6
Install size
15.4 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-transform-inline-consecutive-adds

This plugin inlines consecutive property assignments, array pushes, etc.

Example

In

const foo = {};
foo.a = 42;
foo.b = ["hi"];
foo.c = bar();
foo.d = "str";

...
const bar = [];
bar.push(1);
bar.push(2);

Out

const foo = {
  a: 42,
  b: ["hi"],
  c: bar(),
  d: "str"
};

...
const bar = [1, 2];

Installation

npm install babel-plugin-transform-inline-consecutive-adds --save-dev

Usage

.babelrc

{
  "plugins": ["transform-inline-consecutive-adds"]
}

Via CLI

babel --plugins transform-inline-consecutive-adds script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["transform-inline-consecutive-adds"]
});

Keywords

FAQs

Last updated on 14 May 2018

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