Skip to content

Commit

Permalink
fix(themes): undefined/connector printing with label
Browse files Browse the repository at this point in the history
  • Loading branch information
drawnepicenter committed Aug 11, 2016
1 parent a020355 commit af53971
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ exports.label = (theme, direction, text, content) => {
const ctstyle = _.get(chalk, theme.content.style)
let label = `${pstyle(theme.prefix.str)}${tstyle(text)}${sstyle(theme.suffix.str)}`
if (direction === 'right') {
content !== null || undefined ? label = `${label}${cnstyle(theme.connector.str)}${ctstyle(content)}` : label = `${label}`
content !== null && content !== undefined ? label = `${label}${cnstyle(theme.connector.str)}${ctstyle(content)}` : label = `${label}`
} else if (direction === 'down') {
content !== null || undefined ? label = `${label}\n${cnstyle(theme.connector.str)}${ctstyle(content)}` : label = `${label}`
content !== null && content !== undefined ? label = `${label}\n${cnstyle(theme.connector.str)}${ctstyle(content)}` : label = `${label}`
} else { throw new Error("Unsupported label direction, use 'down' or 'right'.") }
console.log(label)
return label
Expand Down

0 comments on commit af53971

Please sign in to comment.