MCPcopy Index your code
hub / github.com/developit/optimize-plugin / prettyBytes

Function prettyBytes

test/_util.js:33–36  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

31 let modernSize = 0;
32 let legacySize = 0;
33 const prettyBytes = (size) => {
34 if (size > 1500) return (size / 1000).toFixed(2) + 'kB';
35 return size + 'b';
36 };
37 const showSize = async (file) => {
38 const size = await gzipSize(assets[file]);
39 let str = `\n ${file}: ${prettyBytes(size)}`;

Callers 2

showSizeFunction · 0.85
printSizesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected