(node: TSESTree.Node)
| 47 | ) |
| 48 | }, |
| 49 | getNestedIdentifiers(node: TSESTree.Node): Array<TSESTree.Identifier> { |
| 50 | const identifiers: Array<TSESTree.Identifier> = [] |
| 51 | |
| 52 | if (ASTUtils.isIdentifier(node)) { |
| 53 | identifiers.push(node) |
| 54 | } |
| 55 | |
| 56 | if ('arguments' in node) { |
| 57 | node.arguments.forEach((x) => { |
| 58 | identifiers.push(...ASTUtils.getNestedIdentifiers(x)) |
| 59 | }) |
| 60 | } |
| 61 | |
| 62 | if ('elements' in node) { |
| 63 | node.elements.forEach((x) => { |
| 64 | if (x !== null) { |
| 65 | identifiers.push(...ASTUtils.getNestedIdentifiers(x)) |
| 66 | } |
| 67 | }) |
| 68 | } |
| 69 | |
| 70 | if ('properties' in node) { |
| 71 | node.properties.forEach((x) => { |
| 72 | identifiers.push(...ASTUtils.getNestedIdentifiers(x)) |
| 73 | }) |
| 74 | } |
| 75 | |
| 76 | if ('expressions' in node) { |
| 77 | node.expressions.forEach((x) => { |
| 78 | identifiers.push(...ASTUtils.getNestedIdentifiers(x)) |
| 79 | }) |
| 80 | } |
| 81 | |
| 82 | if ('left' in node) { |
| 83 | identifiers.push(...ASTUtils.getNestedIdentifiers(node.left)) |
| 84 | } |
| 85 | |
| 86 | if ('right' in node) { |
| 87 | identifiers.push(...ASTUtils.getNestedIdentifiers(node.right)) |
| 88 | } |
| 89 | |
| 90 | if (node.type === AST_NODE_TYPES.Property) { |
| 91 | identifiers.push(...ASTUtils.getNestedIdentifiers(node.value)) |
| 92 | } |
| 93 | |
| 94 | if (node.type === AST_NODE_TYPES.SpreadElement) { |
| 95 | identifiers.push(...ASTUtils.getNestedIdentifiers(node.argument)) |
| 96 | } |
| 97 | |
| 98 | if (node.type === AST_NODE_TYPES.MemberExpression) { |
| 99 | identifiers.push(...ASTUtils.getNestedIdentifiers(node.object)) |
| 100 | } |
| 101 | |
| 102 | if (node.type === AST_NODE_TYPES.UnaryExpression) { |
| 103 | identifiers.push(...ASTUtils.getNestedIdentifiers(node.argument)) |
| 104 | } |
| 105 | |
| 106 | if (node.type === AST_NODE_TYPES.ChainExpression) { |
nothing calls this directly
no outgoing calls
no test coverage detected