babel-plugin-transform-undefined-to-void
Replace references to `undefined` with `void 0`
Last updated 7 years ago by boopathi .
MIT · Repository · Bugs · Original npm
$ cnpm install babel-plugin-transform-undefined-to-void 
SYNC missed versions from official npm registry.

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

Usage

Via .babelrc (Recommended)

.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"]
});

Current Tags

  • 6.9.4                                ...           latest (7 years ago)

4 Versions

  • 0.0.3                                ...           9 years ago
  • 0.0.1                                ...           9 years ago
  • 6.10.0-alpha.9                                ...           7 years ago
  • 6.9.4                                ...           7 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org