MCPcopy
hub / github.com/codeaashu/claude-code / formatBytes

Function formatBytes

web/components/file-viewer/FileInfoBar.tsx:11–15  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

9}
10
11function formatBytes(bytes: number): string {
12 if (bytes < 1024) return `${bytes} B`;
13 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
14 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
15}
16
17const LANGUAGE_LABELS: Record<string, string> = {
18 typescript: "TypeScript",

Callers 1

FileInfoBarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected