Fix typescript generator params (#9524)
* Fix typescript generator params * add TSOptionalType, TSRestType, add more test
This commit is contained in:
committed by
Nicolò Ribaudo
parent
5bb1bb080f
commit
bbb4d7b6d7
@@ -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 []);;);
|
||||
|
||||
Reference in New Issue
Block a user