(bytes)
| 290 | } |
| 291 | |
| 292 | function formatBytes(bytes) { |
| 293 | if (bytes === 0) return '0 B' |
| 294 | const k = 1024 |
| 295 | const sizes = ['B', 'KB', 'MB', 'GB'] |
| 296 | const i = Math.floor(Math.log(bytes) / Math.log(k)) |
| 297 | return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i] |
| 298 | } |
| 299 | |
| 300 | function createProgressBar(percentage, width = 30) { |
| 301 | const filled = Math.round((width * percentage) / 100) |
no outgoing calls
no test coverage detected