$ cnpm install @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.
npm i @putout/plugin-apply-is-array
{
"rules": {
"apply-is-array": "on"
}
}
x instanceof Array;
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);
MIT
Copyright 2013 - present © cnpmjs.org | Home |