(downloadCount)
| 512 | }; |
| 513 | }, |
| 514 | formatDownloadCount(downloadCount) { |
| 515 | const units = ["", "K", "M", "B", "T"]; |
| 516 | let index = 0; |
| 517 | |
| 518 | while (downloadCount >= 1000 && index < units.length - 1) { |
| 519 | downloadCount /= 1000; |
| 520 | index++; |
| 521 | } |
| 522 | |
| 523 | const countStr = |
| 524 | downloadCount < 10 ? downloadCount.toFixed(2) : downloadCount.toFixed(1); |
| 525 | const trimmedCountStr = countStr.replace(/\.?0+$/, ""); |
| 526 | |
| 527 | return `${trimmedCountStr}${units[index]}`; |
| 528 | }, |
| 529 | normalizeMtime(value) { |
| 530 | if (value == null) return null; |
| 531 | const time = value instanceof Date ? value.getTime() : Number(value); |
nothing calls this directly
no outgoing calls
no test coverage detected