chore: extract a model file item

This commit is contained in:
jialin
2025-04-08 19:19:41 +08:00
parent 5766a50bc2
commit d62e43790c
23 changed files with 207 additions and 142 deletions
+2 -2
View File
@@ -25,8 +25,8 @@ export const convertFileSize = (
sizeInBytes?: number,
prec = 1,
allowEmpty = false
): string => {
if (!sizeInBytes) return allowEmpty ? '' : '0';
): string | number => {
if (!sizeInBytes) return allowEmpty ? '' : 0;
const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB'];
let size = sizeInBytes;