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

Function formatBytes

packages/opencode/src/session/tools.ts:577–581  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

575}
576
577function formatBytes(value: number) {
578 if (value < 1024) return `${value} B`
579 if (value < 1024 * 1024) return `${Math.ceil(value / 1024)} KB`
580 return `${Math.ceil(value / (1024 * 1024))} MB`
581}
582
583export * as SessionTools from "./tools"

Callers 2

tools.tsFile · 0.85
formatMcpResourceContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected