Skip to content

Commit 100ead4

Browse files
committed
Added a lot of transformers for expressions and statements
1 parent e4050ca commit 100ead4

File tree

5 files changed

+273
-158
lines changed

5 files changed

+273
-158
lines changed

src/TSHelper.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ export class TSHelper {
5656
return false;
5757
}
5858

59+
public static isIdentifierExported(
60+
identifier: ts.Identifier, scope: ts.ModuleDeclaration | ts.SourceFile, checker: ts.TypeChecker): boolean {
61+
const identifierSymbol = checker.getTypeAtLocation(scope).getSymbol();
62+
if (identifierSymbol.exports) {
63+
return identifierSymbol.exports.has(identifier.escapedText);
64+
}
65+
66+
return false;
67+
}
68+
5969
public static isInDestructingAssignment(node: ts.Node): boolean {
6070
return node.parent && ((ts.isVariableDeclaration(node.parent) && ts.isArrayBindingPattern(node.parent.name))
6171
|| (ts.isBinaryExpression(node.parent) && ts.isArrayLiteralExpression(node.parent.left)));

0 commit comments

Comments
 (0)