(bytes: number)
| 1 | import { c } from "./colors.js"; |
| 2 | |
| 3 | export function formatBytes(bytes: number): string { |
| 4 | if (bytes < 1024) return `${bytes} B`; |
| 5 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; |
| 6 | return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; |
| 7 | } |
| 8 | |
| 9 | export function formatDuration(ms: number): string { |
| 10 | const seconds = ms / 1000; |
no outgoing calls
no test coverage detected