MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / formatBytes

Function formatBytes

src/context/formatter.ts:290–298  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

288 * Format bytes as human-readable string
289 */
290export function formatBytes(bytes: number): string {
291 if (bytes < 1024) {
292 return `${bytes} bytes`;
293 } else if (bytes < 1024 * 1024) {
294 return `${(bytes / 1024).toFixed(1)} KB`;
295 } else {
296 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
297 }
298}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected