mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(48166): skip checking module.exports in a truthiness call expression (#48337)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user