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

1.0.0 • Public • Published

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'),
      ]
    }
  }
]

Readme

Keywords

Package Sidebar

Install

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

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

2.58 kB

Total Files

5

Last publish

Collaborators

  • jayjaycross