* Format bytes to human-readable string
(bytes: number)
| 619 | * Format bytes to human-readable string |
| 620 | */ |
| 621 | function formatBytes(bytes: number): string { |
| 622 | if (bytes < 1024) { |
| 623 | return `${bytes}B` |
| 624 | } |
| 625 | if (bytes < 1024 * 1024) { |
| 626 | return `${(bytes / 1024).toFixed(1)}KB` |
| 627 | } |
| 628 | return `${(bytes / (1024 * 1024)).toFixed(1)}MB` |
| 629 | } |
| 630 | |
| 631 | export const executeCommandTool = new ExecuteCommandTool() |
no outgoing calls
no test coverage detected