fix: remove unnecessary units in humanSize.ts

This commit is contained in:
alikia2x 2024-07-29 18:38:13 +08:00
parent 0f01c05830
commit d562c1c9a5
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aquavox",
"version": "1.14.0",
"version": "1.14.1",
"private": false,
"scripts": {
"dev": "vite dev",

View File

@ -1,6 +1,6 @@
export default function toHumanSize(size: number | undefined){
if (!size) return '0 B'
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const units = ['B', 'KB', 'MB', 'GB'];
let unitIndex = 0;
while (size >= 1000 && unitIndex < units.length - 1) {
size /= 1000;