Skip to content

Commit d0eae6f

Browse files
printer: use wrap util function in more places (#2934)
1 parent b6b2789 commit d0eae6f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/language/printer.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,7 @@ const printDocASTReducer: any = {
180180
UnionTypeDefinition: ({ description, name, directives, types }) =>
181181
wrap('', description, '\n') +
182182
join(
183-
[
184-
'union',
185-
name,
186-
join(directives, ' '),
187-
types && types.length !== 0 ? '= ' + join(types, ' | ') : '',
188-
],
183+
['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],
189184
' ',
190185
),
191186

@@ -253,7 +248,7 @@ const printDocASTReducer: any = {
253248
'extend union',
254249
name,
255250
join(directives, ' '),
256-
types && types.length !== 0 ? '= ' + join(types, ' | ') : '',
251+
wrap('= ', join(types, ' | ')),
257252
],
258253
' ',
259254
),

0 commit comments

Comments
 (0)