2.0.1 β€’ Published 1 year ago

@putout/plugin-convert-typeof-to-is-type v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@putout/plugin-convert-typeof-to-is-type NPM version

The typeof operator 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 -D

Rule

{
    "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

2.0.1

1 year ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

2.0.0

2 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago