import type { TSESTree } from '@typescript-eslint/experimental-utils' ; const MODULE_DECLARATION_NODES = [ 'ImportDeclaration' , 'ExportNamedDeclaration' , 'ExportDefaultDeclaration' , 'ExportAllDeclaration' , ] ; export function isArrowFunctionExpression ( node ) { return node !== undefined && node . type === 'ArrowFunctionExpression' ; } export function isAssignmentExpression ( node ) { return node !== undefined && node . type === 'AssignmentExpression' ; } export function isBinaryExpression ( node ) { return node !== undefined && node . type === 'BinaryExpression' ; } export function isBlockStatement ( node ) { return node !== undefined && node . type === 'BlockStatement' ; } export function isBooleanLiteral ( node ) { return isLiteral ( node ) && typeof node . value === 'boolean' ; } export function isCallExpression ( node ) { return node !== undefined && node . type === 'CallExpression' ; } export function isConditionalExpression ( node ) { return node !== undefined && node . type === 'ConditionalExpression' ; } export function isContinueStatement ( node ) { return node !== undefined && node . type === 'ContinueStatement' ; } export function isExpressionStatement ( node ) { return node !== undefined && node . type === 'ExpressionStatement' ; } export function isFunctionDeclaration ( node ) { return node !== undefined && node . type === 'FunctionDeclaration' ; } export function isFunctionExpression ( node ) { return node !== undefined && node . type === 'FunctionExpression' ; } export function isIdentifier ( node ) { return node !== undefined && node . type === 'Identifier' ; } export function isIfStatement ( node ) { return node !== undefined && node . type === 'IfStatement' ; } export function isLiteral ( node ) { return node !== undefined && node . type === 'Literal' ; } export function isLogicalExpression ( node ) { return node !== undefined && node . type === 'LogicalExpression' ; } export function isMemberExpression ( node ) { return node !== undefined && node . type === 'MemberExpression' ; } export function isModuleDeclaration ( node ) { return node !== undefined && MODULE_DECLARATION_NODES . includes ( node . type ) ; } export function isObjectExpression ( node ) { return node !== undefined && node . type === 'ObjectExpression' ; } export function isReturnStatement ( node ) { return node !== undefined && node . type === 'ReturnStatement' ; } export function isThrowStatement ( node ) { return node !== undefined && node . type === 'ThrowStatement' ; } export function isVariableDeclaration ( node ) { return node !== undefined && node . type === 'VariableDeclaration' ; }