(bytes)
| 627 | } |
| 628 | |
| 629 | function formatBytes(bytes) { |
| 630 | if (bytes === null || typeof bytes === 'undefined') return '-'; |
| 631 | const n = Number(bytes); |
| 632 | if (!Number.isFinite(n)) return '-'; |
| 633 | if (n < 1024) return n + ' B'; |
| 634 | if (n < 1048576) return (n / 1024).toFixed(2) + ' KB'; |
| 635 | if (n < 1073741824) return (n / 1048576).toFixed(2) + ' MB'; |
| 636 | return (n / 1073741824).toFixed(2) + ' GB'; |
| 637 | } |
| 638 | |
| 639 | function formatDate(value) { |
| 640 | if (!value) return '-'; |
no outgoing calls
no test coverage detected