eslint-plugin-unicorn
Version:
More than 300 powerful ESLint rules
12 lines (9 loc) • 389 B
JavaScript
/**
Check if a node is the `arguments` object.
`arguments` is a language binding that is never an `Array`, unlike an unknown identifier, so unlike most receivers its type does not have to be resolved to know what methods it has.
@param {Node} node
@returns {boolean}
*/
export default function isArgumentsObject(node) {
return node.type === 'Identifier' && node.name === 'arguments';
}