@putout/plugin-convert-typeof-to-is-type
putout plugin adds ability to convert typeof to is type
Last updated 5 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-convert-typeof-to-is-type 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 2.0.1                                ...           latest (4 years ago)

12 Versions

  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           5 years ago
  • 1.8.0                                ...           5 years ago
  • 1.7.0                                ...           5 years ago
  • 1.6.0                                ...           5 years ago
  • 1.5.0                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Total 19
Today 0
This Week 0
This Month 13
Last Day 0
Last Week 12
Last Month 6
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE