Add method property to ObjectTypeProperty (#7005)
This commit is contained in:
@@ -182,7 +182,8 @@ export function FunctionTypeAnnotation(node: Object, parent: Object) {
|
||||
// this node type is overloaded, not sure why but it makes it EXTREMELY annoying
|
||||
if (
|
||||
parent.type === "ObjectTypeCallProperty" ||
|
||||
parent.type === "DeclareFunction"
|
||||
parent.type === "DeclareFunction" ||
|
||||
(parent.type === "ObjectTypeProperty" && parent.method)
|
||||
) {
|
||||
this.token(":");
|
||||
} else {
|
||||
@@ -437,8 +438,10 @@ export function ObjectTypeProperty(node: Object) {
|
||||
this._variance(node);
|
||||
this.print(node.key, node);
|
||||
if (node.optional) this.token("?");
|
||||
this.token(":");
|
||||
this.space();
|
||||
if (!node.method) {
|
||||
this.token(":");
|
||||
this.space();
|
||||
}
|
||||
this.print(node.value, node);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user