Skip to content

Commit d9df3ae

Browse files
committed
Match flow syntax more closer, prefer something simple
1 parent 0c43424 commit d9df3ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ function formatType(node, getHref) {
8989

9090
case Syntax.TypeApplication:
9191
return formatType(node.expression, getHref)
92-
.concat(commaList(getHref, node.applications, '.<', '>'));
92+
.concat(commaList(getHref, node.applications, '<', '>'));
9393
case Syntax.UnionType:
94-
return commaList(getHref, node.elements, '(', ')', '|');
94+
return commaList(getHref, node.elements, '(', ')', ' | ');
9595
case Syntax.ArrayType:
9696
return commaList(getHref, node.elements, '[', ']');
9797
case Syntax.RecordType:
@@ -132,7 +132,7 @@ function formatType(node, getHref) {
132132
// lets the expression be omitted.
133133
return decorate(formatType(node.expression, getHref), '...', true);
134134
case Syntax.OptionalType:
135-
return decorate(formatType(node.expression, getHref), '=').concat(
135+
return decorate(decorate(formatType(node.expression, getHref), '[', true), ']').concat(
136136
node.default ? t('(default ' + node.default + ')') : []);
137137
case Syntax.NonNullableType:
138138
return decorate(formatType(node.expression, getHref), '!', node.prefix);

0 commit comments

Comments
 (0)