Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-remove-undefined

Package Overview
Dependencies
Maintainers
6
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-remove-undefined

This removes rvals that are equivalent to undefined wherever possible

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
517K
increased by9.3%
Maintainers
6
Weekly downloads
 
Created
Source

babel-plugin-transform-remove-undefined

For variable assignments, this removes rvals that evaluate to undefined (vars in functions only). For functions, this removes return arguments that evaluate to undefined.

Example

In

let a = void 0;
function foo() {
  var b = undefined;
  return undefined;
}

Out

let a;
function foo() {
  var b;
  return;
}

Installation

npm install babel-plugin-transform-remove-undefined

Usage

.babelrc

{
  "plugins": ["babel-plugin-transform-remove-undefined"]
}

Via CLI

babel --plugins babel-plugin-transform-remove-undefined script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["babel-plugin-transform-remove-undefined"]
});

Keywords

FAQs

Package last updated on 13 Jun 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc