mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make parseTypeOrTypePredicate terser.
This commit is contained in:
@@ -2541,11 +2541,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function parseTypeOrTypePredicate(): TypeNode {
|
||||
let typePredicateVariable: Identifier;
|
||||
if (isIdentifier()) {
|
||||
typePredicateVariable = tryParse(parseTypePredicatePrefix);
|
||||
}
|
||||
|
||||
const typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
|
||||
const type = parseType();
|
||||
if (typePredicateVariable) {
|
||||
const node = <TypePredicateNode>createNode(SyntaxKind.TypePredicate, typePredicateVariable.pos);
|
||||
|
||||
Reference in New Issue
Block a user