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

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

Via .babelrc (Recommended)

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

Current Tags

  • 1.1.6                                ...           latest (5 years ago)

9 Versions

  • 1.1.6                                ...           5 years ago
  • 1.1.5                                ...           5 years ago
  • 1.1.4                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 4
This Week 598
This Month 1,401
Last Day 191
Last Week 1,250
Last Month 4,259
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |