fix(48166): skip checking module.exports in a truthiness call expression (#48337)

This commit is contained in:
Oleksandr T
2022-03-28 08:23:20 -07:00
committed by GitHub
parent eb95b32dfb
commit c720ad6ffb
4 changed files with 51 additions and 0 deletions
+1
View File
@@ -37679,6 +37679,7 @@ namespace ts {
(condExpr.operatorToken.kind === SyntaxKind.BarBarToken || condExpr.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)
? condExpr.right
: condExpr;
if (isModuleExportsAccessExpression(location)) return;
const type = checkTruthinessExpression(location);
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
if (getFalsyFlags(type) || isPropertyExpressionCast) return;