@putout/plugin-convert-typeof-to-is-type
🐊Putout plugin adds ability to convert typeof to is type
Last updated 3 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (3 years ago)

12 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |