MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / formatBytes

Function formatBytes

src/core/tools/ExecuteCommandTool.ts:621–629  ·  view source on GitHub ↗

* Format bytes to human-readable string

(bytes: number)

Source from the content-addressed store, hash-verified

619 * Format bytes to human-readable string
620 */
621function formatBytes(bytes: number): string {
622 if (bytes < 1024) {
623 return `${bytes}B`
624 }
625 if (bytes < 1024 * 1024) {
626 return `${(bytes / 1024).toFixed(1)}KB`
627 }
628 return `${(bytes / (1024 * 1024)).toFixed(1)}MB`
629}
630
631export const executeCommandTool = new ExecuteCommandTool()

Callers 1

formatPersistedOutputFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected