(bytes: number)
| 288 | * Format bytes as human-readable string |
| 289 | */ |
| 290 | export function formatBytes(bytes: number): string { |
| 291 | if (bytes < 1024) { |
| 292 | return `${bytes} bytes`; |
| 293 | } else if (bytes < 1024 * 1024) { |
| 294 | return `${(bytes / 1024).toFixed(1)} KB`; |
| 295 | } else { |
| 296 | return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; |
| 297 | } |
| 298 | } |
nothing calls this directly
no outgoing calls
no test coverage detected