@putout/plugin-convert-typeof-to-is-type
v2.0.1
Published
šPutout plugin adds ability to convert typeof to is type
Maintainers
Readme
@putout/plugin-convert-typeof-to-is-type 
The
typeofoperator returns a string indicating the type of the unevaluated operand.(c) MDN
šPutout plugin adds ability to convert typeof to is type. Merged to @putout/plugin-types.
Install
npm i @putout/plugin-convert-typeof-to-is-type -DRule
{
"rules": {
"convert-typeof-to-is-type": "on"
}
}ā Example of incorrect code
if (typeof a === 'boolean')
return x;ā Example of correct code
const isBool = (a) => typeof a === 'boolean';
if (isBool(a))
return x;License
MIT
