-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathis-node-of-type.ts
61 lines (60 loc) · 1.99 KB
/
is-node-of-type.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils';
export const isArrayExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ArrayExpression
);
export const isArrowFunctionExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ArrowFunctionExpression
);
export const isBlockStatement = ASTUtils.isNodeOfType(
AST_NODE_TYPES.BlockStatement
);
export const isCallExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.CallExpression
);
export const isExpressionStatement = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ExpressionStatement
);
export const isVariableDeclaration = ASTUtils.isNodeOfType(
AST_NODE_TYPES.VariableDeclaration
);
export const isAssignmentExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.AssignmentExpression
);
export const isSequenceExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.SequenceExpression
);
export const isImportDeclaration = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ImportDeclaration
);
export const isImportDefaultSpecifier = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ImportDefaultSpecifier
);
export const isImportNamespaceSpecifier = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ImportNamespaceSpecifier
);
export const isImportSpecifier = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ImportSpecifier
);
export const isJSXAttribute = ASTUtils.isNodeOfType(
AST_NODE_TYPES.JSXAttribute
);
export const isLiteral = ASTUtils.isNodeOfType(AST_NODE_TYPES.Literal);
export const isMemberExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.MemberExpression
);
export const isNewExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.NewExpression
);
export const isObjectExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ObjectExpression
);
export const isObjectPattern = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ObjectPattern
);
export const isProperty = ASTUtils.isNodeOfType(AST_NODE_TYPES.Property);
export const isReturnStatement = ASTUtils.isNodeOfType(
AST_NODE_TYPES.ReturnStatement
);
export const isFunctionExpression = ASTUtils.isNodeOfType(
AST_NODE_TYPES.FunctionExpression
);