MCPcopy
hub / github.com/virattt/dexter / formatFileSize

Function formatFileSize

src/tools/fetch/web-fetch.ts:32–36  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

30};
31
32function formatFileSize(bytes: number): string {
33 if (bytes < 1024) return `${bytes} B`;
34 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
35 return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
36}
37
38/**
39 * Create a web_fetch tool configured with the given model. The model is used

Callers 1

createWebFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected