(value: number, unit: string)
| 310 | } |
| 311 | |
| 312 | function convertSwapToBytes(value: number, unit: string) { |
| 313 | const mb = convertMemoryToMB(value, unit); |
| 314 | if (!Number.isFinite(mb) || mb <= 0) { |
| 315 | return 0; |
| 316 | } |
| 317 | return Math.max(0, Math.round(mb * BYTES_PER_MB)); |
| 318 | } |
| 319 | |
| 320 | function bytesToMB(bytes: number) { |
| 321 | if (!bytes) { |
no test coverage detected