MCPcopy Index your code
hub / github.com/anomalyco/opencode / formatSize

Function formatSize

packages/opencode/src/cli/cmd/uninstall.ts:340–345  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

338}
339
340function formatSize(bytes: number): string {
341 if (bytes < 1024) return `${bytes} B`
342 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
343 if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
344 return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`
345}
346
347function shortenPath(p: string): string {
348 const home = os.homedir()

Callers 1

showRemovalSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected