(bytes: number)
| 181 | } |
| 182 | |
| 183 | function formatBytes(bytes: number): string { |
| 184 | if (bytes < 1024) return `${bytes} B`; |
| 185 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; |
| 186 | if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; |
| 187 | return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`; |
| 188 | } |
| 189 | |
| 190 | function formatDuration(ms: number): string { |
| 191 | if (ms < 1000) return `${ms.toFixed(0)}ms`; |
no outgoing calls
no test coverage detected