From 9c92200cf277c6d64344eb2b398668943e3742d6 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Mon, 26 Jan 2026 18:55:56 -0700 Subject: [PATCH] chore: remove unused formatBytes.ts file The file was left over after size calculation was removed from task-storage-size.ts for performance reasons. Knip correctly detected it as unused. --- src/utils/formatBytes.ts | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 src/utils/formatBytes.ts diff --git a/src/utils/formatBytes.ts b/src/utils/formatBytes.ts deleted file mode 100644 index 51a621fdd7..0000000000 --- a/src/utils/formatBytes.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Formats bytes into a human-readable string with appropriate units. - * - * Note: This is intentionally simple (base-2 / 1024) and consistent with existing - * formatting expectations in tests and UI. - */ -export function formatBytes(bytes: number): string { - if (bytes === 0) return "0 B" - - const units = ["B", "KB", "MB", "GB", "TB"] - const k = 1024 - const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), units.length - 1) - const size = bytes / Math.pow(k, i) - - // Use 2 decimal places for MB and above, 0 for B and KB - const decimals = i >= 2 ? 2 : 0 - return `${size.toFixed(decimals)} ${units[i]}` -}