Skip to content

Commit

Permalink
fix: better tweaks for the rendering UnionTypes
Browse files Browse the repository at this point in the history
Signed-off-by: Charlike Mike Reagent <olsten.larck@gmail.com>
  • Loading branch information
Charlike Mike Reagent committed Aug 11, 2018
1 parent 4807054 commit 49c4809
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/plugins/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ function createRender(comments, fp) {
output.push('**Params**');
comment.params.forEach((param) => {
const name = param.isOptional ? `[${param.name}]` : param.name;
const { type } = param.type;

let str = param.type.name;
if (!str && type.type === 'UnionType') {
str = type.elements.map((x) => x.name).join('|');
if (!str && param.type.type === 'UnionType') {
str = param.type.elements.map((x) => x.name).join('|');
}

output.push(
Expand Down

0 comments on commit 49c4809

Please sign in to comment.