@vbarbarosh/node-helpers
Advanced tools
Comparing version 3.23.0 to 3.23.1
@@ -5,3 +5,3 @@ { | ||
"name": "@vbarbarosh/node-helpers", | ||
"version": "3.23.0", | ||
"version": "3.23.1", | ||
"description": "A set of helpers for JavaScript/Node.js", | ||
@@ -8,0 +8,0 @@ "files": [ |
@@ -9,2 +9,5 @@ const format_bytes = require('./format_bytes'); | ||
const bps = is_number_gt(rate, 0) ? `${format_bytes(rate)}/s` : '~'; | ||
if (done > total) { | ||
return `${format_bytes(done)} at ${bps} duration=${format_seconds(duration)}`; | ||
} | ||
if (is_number_gt(total, 0)) { | ||
@@ -11,0 +14,0 @@ const eta_str = is_number_gt(eta, 0) ? format_seconds(eta) : '~'; |
@@ -9,2 +9,4 @@ const assert = require('assert'); | ||
['25.25% | 5.0MB of 15.0MB at 10.0MB/s ETA 00:00:05 duration=00:00:01', {percents: 0.2525, total: 15*1024*1024, done: 5*1024*1024, rate: 10*1024*1024, eta: 5, duration: 1}], | ||
// edge case: done > total | ||
['15.0MB at 10.0MB/s duration=00:00:01', {percents: 5.2525, total: 5*1024*1024, done: 15*1024*1024, rate: 10*1024*1024, eta: 5, duration: 1}], | ||
]; | ||
@@ -11,0 +13,0 @@ |
110668
3184