Skip to content

Commit

Permalink
Fix formatting in member generation
Browse files Browse the repository at this point in the history
  • Loading branch information
daogrady committed Oct 16, 2024
1 parent 4a1947b commit 9b21694
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/components/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ function createMember ({name, type = undefined, initialiser = undefined, stateme
if (isStatic) parts.push('static')
if (isOverride) parts.push('override')
if (isReadonly) parts.push('readonly')

parts.push(name)
if (type) parts.push(`: ${type}`)
if (initialiser) parts.push(` = ${initialiser}`)
const nameAndType = type
? `${name}: ${type}`
: name
parts.push(nameAndType)
if (initialiser) parts.push(`= ${initialiser}`)

const member = parts.join(' ')
return statementEnd
Expand Down

0 comments on commit 9b21694

Please sign in to comment.