@putout/plugin-apply-is-array
v3.0.2
Published
šPutout plugin adds ability to apply Array.isArray()
Downloads
7,921
Maintainers
Readme
@putout/plugin-apply-is-array 
The
Array.isArray()method determines whether the passed value is anArray. When checking forArrayinstance,Array.isArray()is preferred overinstanceofbecause it works throughiframes.(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-arrayRule
{
"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
