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

Function formatFileSize

src/bin/codegraph.ts:1222–1224  ·  view source on GitHub ↗

A file size as people say it: "1.9 MB", "640 KB".

(bytes: number)

Source from the content-addressed store, hash-verified

1220
1221/** A file size as people say it: "1.9 MB", "640 KB". */
1222function formatFileSize(bytes: number): string {
1223 return bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1)} MB` : `${Math.ceil(bytes / 1024)} KB`;
1224}
1225
1226/**
1227 * One line naming the source files left out of the graph for their size, or

Callers 1

describeOversizeFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected