Socket
Socket
Sign inDemoInstall

babel-plugin-undefined-to-void

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-undefined-to-void

Replace references to `undefined` with `void 0`


Version published
Weekly downloads
71K
decreased by-12.1%
Maintainers
1
Install size
2.85 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-undefined-to-void

Some JavaScript implementations allow undefined to be overwritten, this may lead to peculiar bugs that are extremely hard to track down.

This plugin transforms undefined into void 0 which returns undefined regardless of if it's been reassigned.

Example

In

foo === undefined;

Out

foo === void 0;

Installation

$ npm install babel-plugin-undefined-to-void

Usage

.babelrc

{
  "plugins": ["undefined-to-void"]
}

Via CLI

$ babel --plugins undefined-to-void script.js

Via Node API

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

Keywords

FAQs

Last updated on 15 Jun 2015

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