MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / formatBytes

Function formatBytes

apps/ui/vite.config.ts:21–25  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

19 });
20
21const formatBytes = (bytes: number): string => {
22 if (bytes < 1024) return `${bytes} B`;
23
24 return `${(bytes / 1024).toFixed(2)} kB`;
25};
26
27const toSourceString = (source: string | Uint8Array): string =>
28 typeof source === "string" ? source : Buffer.from(source).toString("utf8");

Callers 1

generateBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected