You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
412 B
11 lines
412 B
module.exports = function isFunction (node) {
|
|
if (typeof node !== 'object' || !node) {
|
|
throw new TypeError('estree-is-function: node must be an object')
|
|
}
|
|
|
|
if (typeof node.type !== 'string') {
|
|
throw new TypeError('estree-is-function: node must have a string type')
|
|
}
|
|
|
|
return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression'
|
|
}
|