Skip to content

Commit e3d810c

Browse files
Fix multi array type
1 parent 44e165d commit e3d810c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ const wrapComment = (comment) => {
2727

2828
const typify = (type) => {
2929
// Capture some weird edge cases
30+
const originalType = type
3031
if (type.type && typeof type.type === 'object') {
3132
type = type.type
3233
}
3334

3435
if (Array.isArray(type)) {
35-
return Array.from(new Set(type.map(t => typify(t)))).join(' | ')
36+
const arrayType = Array.from(new Set(type.map(t => typify(t)))).join(' | ')
37+
if (originalType.collection) {
38+
return `Array<${arrayType}>`
39+
}
40+
return arrayType
3641
}
3742

3843
if (!type) return 'any'

0 commit comments

Comments
 (0)