(bytes: number, unit: ByteUnit)
| 61 | }; |
| 62 | |
| 63 | export function convertBytes(bytes: number, unit: ByteUnit) { |
| 64 | switch (unit) { |
| 65 | case "B": |
| 66 | return bytes; |
| 67 | case "KB": |
| 68 | return bytes / Number(kilobyte); |
| 69 | case "MB": |
| 70 | return bytes / Number(megabyte); |
| 71 | case "GB": |
| 72 | return bytes / Number(gigabyte); |
| 73 | case "TB": |
| 74 | return bytes / Number(terabyte); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | export function formatMemoryUsage( |
| 79 | memoryStats: |
no outgoing calls
no test coverage detected