1.0.2 • Published 9 years ago

babel-plugin-simplify-comparison-operators v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

babel-plugin-simplify-comparison-operators

Convert === and !== to == and != if their types are inferred to be the same.

Example

In

typeof foo === "object";

Out

typeof foo == "object";

Installation

$ npm install babel-plugin-simplify-comparison-operators

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["simplify-comparison-operators"]
}

Via CLI

$ babel --plugins simplify-comparison-operators script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["simplify-comparison-operators"]
});