forked from dsherret/ts-morph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConditionalExpression.ts
40 lines (35 loc) · 1.17 KB
/
ConditionalExpression.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { ts, SyntaxKind } from "../../../typescript";
import { Expression } from "./Expression";
export const ConditionalExpressionBase = Expression;
export class ConditionalExpression extends ConditionalExpressionBase<ts.ConditionalExpression> {
/**
* Gets the condition of the conditional expression.
*/
getCondition(): Expression {
return this._getNodeFromCompilerNode(this.compilerNode.condition);
}
/**
* Gets the question token of the conditional expression.
*/
getQuestionToken() {
return this._getNodeFromCompilerNode(this.compilerNode.questionToken);
}
/**
* Gets the when true expression of the conditional expression.
*/
getWhenTrue(): Expression {
return this._getNodeFromCompilerNode(this.compilerNode.whenTrue);
}
/**
* Gets the colon token of the conditional expression.
*/
getColonToken() {
return this._getNodeFromCompilerNode(this.compilerNode.colonToken);
}
/**
* Gets the when false expression of the conditional expression.
*/
getWhenFalse(): Expression {
return this._getNodeFromCompilerNode(this.compilerNode.whenFalse);
}
}