(transferredBytes: number, totalBytes: number)
| 96 | } |
| 97 | |
| 98 | function formatPercent(transferredBytes: number, totalBytes: number): string { |
| 99 | if (totalBytes <= 0) return '100%'; |
| 100 | return `${Math.min(100, Math.floor((transferredBytes / totalBytes) * 100))}%`; |
| 101 | } |
| 102 | |
| 103 | function formatBytes(bytes: number): string { |
| 104 | if (bytes < 1024) return `${bytes} B`; |
no outgoing calls
no test coverage detected