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

v1.0.0
Make sure that undefined is a always a funcion.
babel-plugin

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'),
      ]
    }
  }
]
npm i babel-plugin-undefined-is-always-a-function

Metadata

  • Unknown
  • Whatever
  • Jack Cross
  • released 3/5/2018

Downloads

Maintainers