Skip to content

Commit

Permalink
Merge pull request #162 from aspida/fix/array_and_nullable
Browse files Browse the repository at this point in the history
[fix] fix #159
  • Loading branch information
Hasu authored Jan 13, 2022
2 parents c147427 + cdca913 commit e5d5b1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/builderUtils/props2String.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export type Prop = {
}

const array2String = (val: PropValue, indent: string) => {
const hasMulti = (val.isEnum || val.hasOf) && Array.isArray(val.value) && val.value.length
const hasMulti =
((val.isEnum || val.hasOf) && Array.isArray(val.value) && val.value.length) || val.nullable
return `${hasMulti ? '(' : ''}${value2String(val, indent)}${hasMulti ? ')' : ''}[]`
}

Expand Down

0 comments on commit e5d5b1a

Please sign in to comment.