(value: number, unit: string)
| 300 | const BYTES_PER_MB = 1024 * 1024; |
| 301 | |
| 302 | function convertMemoryToMB(value: number, unit: string) { |
| 303 | if (!Number.isFinite(value) || value < 0) { |
| 304 | return 0; |
| 305 | } |
| 306 | if (unit === 'GB') { |
| 307 | return value * 1024; |
| 308 | } |
| 309 | return value; |
| 310 | } |
| 311 | |
| 312 | function convertSwapToBytes(value: number, unit: string) { |
| 313 | const mb = convertMemoryToMB(value, unit); |
no outgoing calls
no test coverage detected