Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

babel-plugin-transform-merge-sibling-variables

Package Overview
Dependencies
Maintainers
5
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-merge-sibling-variables

Merge sibling variables into one.

latest
Source
npmnpm
Version
6.9.5
Version published
Weekly downloads
476K
4.78%
Maintainers
5
Weekly downloads
 
Created
Source

babel-plugin-transform-merge-sibling-variables

Merge sibling variables into one.

Example

In

// merge into a single VariableDeclaration
var foo = "bar";
var bar = "foo";
foobar();

// merge into the next for loop
var i = 0;
for (var x = 0; x < 10; x++) {}

Out

var foo = "bar",
    bar = "foo";
foobar();

for (var i = 0, x = 0; x < 10; x++) {}

Installation

npm install babel-plugin-transform-merge-sibling-variables --save-dev

Usage

.babelrc

{
  "plugins": ["transform-merge-sibling-variables"]
}

Via CLI

babel --plugins transform-merge-sibling-variables script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["transform-merge-sibling-variables"]
});

Keywords

babel-plugin

FAQs

Package last updated on 06 May 2022

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