2.0.1 β’ Published 3 years ago
@putout/plugin-convert-typeof-to-is-type v2.0.1
@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