forked from dsherret/ts-morph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
JsxFragment.ts
28 lines (25 loc) · 881 Bytes
/
JsxFragment.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
import { ts } from "../../../typescript";
import { JsxChild } from "../aliases";
import { PrimaryExpression } from "../expression";
import { JsxClosingFragment } from "./JsxClosingFragment";
import { JsxOpeningFragment } from "./JsxOpeningFragment";
export class JsxFragment extends PrimaryExpression<ts.JsxFragment> {
/**
* Gets the children of the JSX fragment.
*/
getJsxChildren(): JsxChild[] {
return this.compilerNode.children.map(c => this._getNodeFromCompilerNode(c));
}
/**
* Gets the opening fragment.
*/
getOpeningFragment(): JsxOpeningFragment {
return this._getNodeFromCompilerNode(this.compilerNode.openingFragment);
}
/**
* Gets the closing fragment.
*/
getClosingFragment(): JsxClosingFragment {
return this._getNodeFromCompilerNode(this.compilerNode.closingFragment);
}
}