File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ const typify = (type) => {
33
33
}
34
34
35
35
if ( Array . isArray ( type ) ) {
36
- const arrayType = Array . from ( new Set ( type . map ( t => typify ( t ) ) ) ) . join ( ' | ' )
36
+ const arrayType = Array . from ( new Set ( type . map ( t => `( ${ typify ( t ) } )` ) ) ) . join ( ' | ' )
37
37
if ( originalType . collection ) {
38
38
return `Array<${ arrayType } >`
39
39
}
Original file line number Diff line number Diff line change @@ -67,11 +67,11 @@ describe('utils', () => {
67
67
} )
68
68
69
69
it ( 'should map an array of types through typify as well' , ( ) => {
70
- expect ( utils . typify ( [ 'String' , 'Float' , 'Boolean' ] ) ) . to . deep . equal ( 'string | number | boolean' )
70
+ expect ( utils . typify ( [ 'String' , 'Float' , 'Boolean' ] ) ) . to . deep . equal ( '( string) | ( number) | ( boolean) ' )
71
71
} )
72
72
73
73
it ( 'should map an array of types through typify as well and remove duplicates' , ( ) => {
74
- expect ( utils . typify ( [ 'String' , 'Float' , 'Double' ] ) ) . to . deep . equal ( 'string | number' )
74
+ expect ( utils . typify ( [ 'String' , 'Float' , 'Double' ] ) ) . to . deep . equal ( '( string) | ( number) ' )
75
75
} )
76
76
77
77
it ( 'should map node objects to the correct type' , ( ) => {
You can’t perform that action at this time.
0 commit comments