@putout/plugin-apply-is-array
putout plugin adds ability use apply Array.isArray()
Last updated 4 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-apply-is-array 
SYNC missed versions from official npm registry.

@putout/plugin-apply-is-array NPM version

The Array.isArray() method determines whether the passed value is an Array. When checking for Array instance, Array.isArray() is preferred over instanceof because it works through iframes.

(c) MDN

????Putout plugin adds ability to apply Array.isArray(). Fits good with @putout/plugin-declare. Merged to @putout/plugin-types.

Install

npm i @putout/plugin-apply-is-array

Rule

{
    "rules": {
        "apply-is-array": "on"
    }
}

❌ Example of incorrect code

x instanceof Array;

✅ Example of correct code

const {isArray} = Array;
isArray(x);

In case of using inline option:

{
    "rules": {
        "apply-is-array": ["on", {
            "inline": true
        }]
    }
}

Array.isArray will be inlined:

Array.isArray(x);

License

MIT

Current Tags

  • 3.0.2                                ...           latest (3 years ago)

6 Versions

  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |