$ cnpm install @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.
npm i @putout/plugin-convert-typeof-to-is-type -D
{
"rules": {
"convert-typeof-to-is-type": "on"
}
}
if (typeof a === 'boolean')
return x;
const isBool = (a) => typeof a === 'boolean';
if (isBool(a))
return x;
MIT
Copyright 2013 - present © cnpmjs.org | Home |