Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit d963aa1

Browse files
author
Roman Labunsky
committed
fix: fixed error when there's no usage
1 parent 1f013c8 commit d963aa1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/cli-renderer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ class Renderer {
6565
`${style(data.name || '')}`,
6666
`${style(data.recommendedVersion || 'No Insight')}`,
6767
`${style(this.trimStringToLength(data.license, 4) || '')}`,
68-
`${style(this.trimStringToLength(data.description, 20) || '')}`,
69-
`${style(this.fractionToPercentageString(data.internalUsage.usage) || 'No Insight')}`
68+
`${style(this.trimStringToLength(data.description, 20) || '')}`
7069
]
70+
71+
if (data.internalUsage)
72+
dataSet.push(`${style(this.fractionToPercentageString(data.internalUsage.usage) || 'No Insight')}`)
7173
if (hasHigherScore) style = style.bold.green
7274
dataSet.push(`${style(Number(data.calculatedScore) || '')}`)
7375
return dataSet

0 commit comments

Comments
 (0)