New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

babel-plugin-minify-guarded-expressions

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-minify-guarded-expressions

## Example

0.4.4
latest
Version published
Weekly downloads
415K
4.31%
Maintainers
5
Weekly downloads
 
Created

babel-plugin-minify-guarded-expressions

Example

In

!x && foo();
alert(0 && new Foo());

Out

x || foo();
alert(0);

Installation

npm install babel-plugin-minify-guarded-expressions --save-dev

Usage

.babelrc

{
  "plugins": ["minify-guarded-expressions"]
}

Via CLI

babel --plugins minify-guarded-expressions script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["minify-guarded-expressions"]
});

Keywords

FAQs

Package last updated on 15 Aug 2019

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