(text: any)
| 338 | } |
| 339 | } |
| 340 | |
| 341 | // Fixed htmlEscape function |
| 342 | async function unitConvert(bytes: number, isBytes: boolean = false): Promise<string> { |
| 343 | const power = 1000; |
| 344 | let value = bytes; |
| 345 | let unitIndex = 0; |
| 346 | const units = isBytes |
| 347 | ? ["B", "KB", "MB", "GB", "TB"] |
| 348 | : ["bps", "Kbps", "Mbps", "Gbps", "Tbps"]; |
| 349 | if (!isBytes) value *= 8; |