We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20c4d8f commit 7c3167dCopy full SHA for 7c3167d
1 file changed
index.js
@@ -34,7 +34,7 @@ const Progress = {
34
index: 0, total: 0, text: '',
35
toString (percent) {
36
if (this.total) return percent = Math.ceil(this.index * 100) / this.total, Progress.option.index = '(' + this.index + '/' + this.total + ')', [Progress.option.index, (Progress.option.percent = parseInt(percent <= 100 ? percent >= 0 ? percent : 0 : 100, 10) + '%', Progress.option.percent), this.text].filter(t => t !== '').join(' ' + Progress.option.dash + ' ')
37
- return ' ' + Progress.option.dash + ' ' + this.text.toString()
+ return this.text !== '' ? ' ' + Progress.option.dash + ' ' + this.text.toString() : ''
38
},
39
appendTo(lines) {
40
if (lines.length) return [...lines].map(({ index, space, str }) => ['\x1b[K', ' '.repeat(Progress.option.space), index ? space + ' ' + Progress.option.newline : Progress.option.header, ' ', index ? (Progress.option.subtitle = str, Progress.option.subtitle) : (Progress.option.title = str, Progress.option.title), index ? '' : this].join('')).join("\n")
0 commit comments