File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,18 @@ const typify = (type) => {
39
39
40
40
if ( typeof type === 'object' ) {
41
41
let newType = type . typeName || type . type || 'any'
42
- if ( newType . toLowerCase ( ) === 'string' && type . possibleValues ) {
43
- newType = `(${ type . possibleValues . map ( value => `'${ value . value } '` ) . join ( ' | ' ) } )`
44
- }
45
- if ( type . collection ) {
46
- type = newType + '[]'
42
+
43
+ if ( newType . toLowerCase ( ) === 'string' && type . possibleValues && type . collection ) {
44
+ // Array<foo | bar> syntax instead of (foo | bar)[]
45
+ newType = `Array<${ type . possibleValues . map ( value => `'${ value . value } '` ) . join ( ' | ' ) } >`
47
46
} else {
48
- type = newType
47
+ if ( newType . toLowerCase ( ) === 'string' && type . possibleValues ) {
48
+ newType = `(${ type . possibleValues . map ( value => `'${ value . value } '` ) . join ( ' | ' ) } )`
49
+ }
50
+ if ( type . collection ) newType += '[]'
49
51
}
52
+
53
+ type = newType
50
54
}
51
55
52
56
switch ( type . toLowerCase ( ) ) {
You can’t perform that action at this time.
0 commit comments