MCPcopy Create free account
hub / github.com/arctic-cli/interface / formatSize

Function formatSize

packages/arctic/src/cli/cmd/uninstall.ts:347–352  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

345}
346
347function formatSize(bytes: number): string {
348 if (bytes < 1024) return `${bytes} B`
349 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
350 if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
351 return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`
352}
353
354function shortenPath(p: string): string {
355 const home = os.homedir()

Callers 1

showRemovalSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected