From 76995712444b75c0da7dd025880d75b7d59bf289 Mon Sep 17 00:00:00 2001 From: ts-upgrade-bot Date: Wed, 6 May 2020 07:25:23 +0000 Subject: [PATCH] Upgrade TypeScript syntax --- src/gen.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gen.ts b/src/gen.ts index f7d8fc9..5b9a45a 100644 --- a/src/gen.ts +++ b/src/gen.ts @@ -738,12 +738,10 @@ export function gen( const context = last(lexerContext) const symbol = checker.getSymbolAtLocation(id) const isDeclarationOutsideOfFunction = - symbol && - symbol.valueDeclaration && + symbol?.valueDeclaration && isOutOfFunction(symbol.valueDeclaration) const isImportedSymbolOutsideOfFunction = - symbol && - symbol.declarations && + symbol?.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === ts.SyntaxKind.ImportSpecifier && isOutOfFunction(symbol.declarations[0])