(bytes: number)
| 41 | } |
| 42 | |
| 43 | function formatBytes(bytes: number): string { |
| 44 | if (bytes < 1024) return `${bytes} B` |
| 45 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(bytes >= 10 * 1024 ? 0 : 1)} KB` |
| 46 | if (bytes < 1024 * 1024 * 1024) { |
| 47 | return `${(bytes / (1024 * 1024)).toFixed(bytes >= 10 * 1024 * 1024 ? 0 : 1)} MB` |
| 48 | } |
| 49 | return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB` |
| 50 | } |
| 51 | |
| 52 | const ASSET_LAYOUT_KEY = 'zen:assets-layout:v1' |
| 53 | type AssetLayout = 'grid' | 'list' |
no outgoing calls
no test coverage detected