Fix typescript generator params (#9524)

* Fix typescript generator params

* add TSOptionalType, TSRestType, add more test
This commit is contained in:
Tan Li Hau
2019-02-18 15:22:22 +08:00
committed by Nicolò Ribaudo
parent 5bb1bb080f
commit bbb4d7b6d7
4 changed files with 49 additions and 3 deletions

View File

@@ -136,6 +136,18 @@ export function TSTypeAssertion() {
return true;
}
export function TSUnionType(node: Object, parent: Object): boolean {
return (
t.isTSArrayType(parent) ||
t.isTSOptionalType(parent) ||
t.isTSIntersectionType(parent) ||
t.isTSUnionType(parent) ||
t.isTSRestType(parent)
);
}
export { TSUnionType as TSIntersectionType };
export function BinaryExpression(node: Object, parent: Object): boolean {
// let i = (1 in []);
// for ((1 in []);;);