(bytes: number)
| 219 | // === Formatters === |
| 220 | |
| 221 | export function formatBytes(bytes: number): string { |
| 222 | if (bytes < 1024) return `${bytes} B` |
| 223 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB` |
| 224 | return `${(bytes / (1024 * 1024)).toFixed(1)} MB` |
| 225 | } |
| 226 | |
| 227 | export function formatDuration(ms: number): string { |
| 228 | if (ms < 1000) return `${ms}ms` |
no outgoing calls
no test coverage detected