(bytes: number)
| 25 | } |
| 26 | |
| 27 | function formatFileSize(bytes: number): string { |
| 28 | if (bytes < 1024) { |
| 29 | return `${bytes}B`; |
| 30 | } else if (bytes < 1024 * 1024) { |
| 31 | return `${(bytes / 1024).toFixed(1)}kB`; |
| 32 | } else { |
| 33 | return `${(bytes / (1024 * 1024)).toFixed(1)}MB`; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | function sanitizeNameForFilename(name: string): string { |
| 38 | // Replace spaces with hyphens |
no outgoing calls
no test coverage detected
searching dependent graphs…