Comparing version 1.16.0 to 1.16.1
@@ -624,3 +624,3 @@ var __defProp = Object.defineProperty; | ||
if (opts.showPercent) { | ||
const percent = Math.round(current / maxNum * 100); | ||
const percent = Math.round(current / Math.max(1, maxNum) * 100); | ||
items.push(`(${percent.toString().padStart("100".toString().length, " ")}%)`); | ||
@@ -666,3 +666,3 @@ } | ||
current, | ||
maxNum, | ||
Math.max(1, maxNum), | ||
Math.max(0, maxWidth - [fullPrefix, suffix, startChar, endChar].join("").length), | ||
@@ -669,0 +669,0 @@ opts |
{ | ||
"name": "swiss-ak", | ||
"version": "1.16.0", | ||
"version": "1.16.1", | ||
"author": "Jack Cannon <jackc@annon.co.uk> (http://c.annon.co.uk/)", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -72,3 +72,3 @@ import * as fn from './fn'; | ||
if (opts.showPercent) { | ||
const percent = Math.round((current / maxNum) * 100); | ||
const percent = Math.round((current / Math.max(1, maxNum)) * 100); | ||
items.push(`(${percent.toString().padStart('100'.toString().length, ' ')}%)`); | ||
@@ -176,3 +176,3 @@ } | ||
current, | ||
maxNum, | ||
Math.max(1, maxNum), | ||
Math.max(0, maxWidth - [fullPrefix, suffix, startChar, endChar].join('').length), | ||
@@ -179,0 +179,0 @@ opts |
Sorry, the diff of this file is not supported yet
230601