babel-plugin-transform-simplify-comparison-operators
Example
In
JavaScript
typeof foo === "object";
Out
JavaScript
typeof foo == "object";
Installation
- npm
- Yarn
- pnpm
npm install babel-plugin-transform-simplify-comparison-operators --save-dev
yarn add babel-plugin-transform-simplify-comparison-operators --dev
pnpm add babel-plugin-transform-simplify-comparison-operators --save-dev
Usage
With a configuration file (Recommended)
babel.config.json
{
"plugins": ["transform-simplify-comparison-operators"]
}
Via CLI
Shell
babel --plugins transform-simplify-comparison-operators script.js
Via Node API
JavaScript
require("@babel/core").transformSync("code", {
plugins: ["transform-simplify-comparison-operators"],
});