Socket
Socket
Sign inDemoInstall

babel-plugin-transform-undefined-to-void

Package Overview
Dependencies
Maintainers
5
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-undefined-to-void

Replace references to `undefined` with `void 0`


Version published
Weekly downloads
371K
increased by1.1%
Maintainers
5
Weekly downloads
 
Created
Source

babel-plugin-transform-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-transform-undefined-to-void --save-dev

Usage

.babelrc

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

Via CLI

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

Via Node API

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

Keywords

FAQs

Package last updated on 14 May 2018

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