Fix flow babel-generator function parantheses (#9523)
This commit is contained in:
committed by
Nicolò Ribaudo
parent
058f057426
commit
5bb1bb080f
@@ -35,7 +35,16 @@ export function NullableTypeAnnotation(node: Object, parent: Object): boolean {
|
||||
return t.isArrayTypeAnnotation(parent);
|
||||
}
|
||||
|
||||
export { NullableTypeAnnotation as FunctionTypeAnnotation };
|
||||
export function FunctionTypeAnnotation(node: Object, parent: Object): boolean {
|
||||
return (
|
||||
// (() => A) | (() => B)
|
||||
t.isUnionTypeAnnotation(parent) ||
|
||||
// (() => A) & (() => B)
|
||||
t.isIntersectionTypeAnnotation(parent) ||
|
||||
// (() => A)[]
|
||||
t.isArrayTypeAnnotation(parent)
|
||||
);
|
||||
}
|
||||
|
||||
export function UpdateExpression(node: Object, parent: Object): boolean {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user