Socket
Socket
Sign inDemoInstall

babel-plugin-transform-undefined-to-void

Package Overview
Dependencies
0
Maintainers
5
Versions
89
Alerts
File Explorer

Advanced tools

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
359K
decreased by-14.47%
Maintainers
5
Install size
2.63 kB
Created
Weekly downloads
 

Readme

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

Last updated on 14 May 2018

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