We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 445421b commit d77945fCopy full SHA for d77945f
1 file changed
src/compiler/checker.ts
@@ -14609,7 +14609,9 @@ namespace ts {
14609
14610
function checkTypeOfExpression(node: TypeOfExpression): Type {
14611
checkExpression(node.expression);
14612
- return stringType;
+ const types: Type[] = [];
14613
+ typeofEQFacts.forEach((_, s) => types.push(getLiteralTypeForText(TypeFlags.StringLiteral, s)));
14614
+ return getUnionType(types);
14615
}
14616
14617
function checkVoidExpression(node: VoidExpression): Type {
0 commit comments