1.0.0 • Published 6 years ago

babel-plugin-undefined-is-always-a-function v1.0.0

Weekly downloads
5
License
-
Repository
github
Last release
6 years ago

babel-plugin-undefined-is-always-a-function

In case undefined-is-a-function is not thorough enough for your use case, this Babel plugin will ensure that undefined is a function in all of your modules.

Example

function isUndefined(value) {
  return value === undefined;
}

Becomes much better:

function undefined() {
  return undefined;
}

function isUndefined(value) {
  return value === undefined;
}

Installation

$ npm install babel-plugin-undefined-is-always-a-function

Usage

.babelrc

{
  "plugins": ["undefined-is-always-a-function"]
}

webpack.config.js

loaders: [
  {
    test: /\.jsx?$/,
    loader: 'babel',
    plugins: []
    options: {
      plugins: [
        require('babel-plugin-undefined-is-always-a-function'),
      ]
    }
  }
]