diff --git a/pkg/api/api_impl.go b/pkg/api/api_impl.go index 843f7f81b87..f7968eb7731 100644 --- a/pkg/api/api_impl.go +++ b/pkg/api/api_impl.go @@ -1146,13 +1146,13 @@ func (ctx *internalContext) Dispose() { func prettyPrintByteCount(n int) string { var size string if n < 1024 { - size = fmt.Sprintf("%db ", n) + size = fmt.Sprintf("%dB ", n) } else if n < 1024*1024 { - size = fmt.Sprintf("%.1fkb", float64(n)/(1024)) + size = fmt.Sprintf("%.1fKiB", float64(n)/(1024)) } else if n < 1024*1024*1024 { - size = fmt.Sprintf("%.1fmb", float64(n)/(1024*1024)) + size = fmt.Sprintf("%.1fMiB", float64(n)/(1024*1024)) } else { - size = fmt.Sprintf("%.1fgb", float64(n)/(1024*1024*1024)) + size = fmt.Sprintf("%.1fGiB", float64(n)/(1024*1024*1024)) } return size } diff --git a/scripts/js-api-tests.js b/scripts/js-api-tests.js index 7d5b847ca72..577144cff1a 100644 --- a/scripts/js-api-tests.js +++ b/scripts/js-api-tests.js @@ -6962,15 +6962,15 @@ let analyzeTests = { } } assert.strictEqual(await esbuild.analyzeMetafile(metafile), ` - out.js 100b 100.0% - ├ lib.js 50b 50.0% - └ entry.js 25b 25.0% + out.js 100B 100.0% + ├ lib.js 50B 50.0% + └ entry.js 25B 25.0% `) assert.strictEqual(await esbuild.analyzeMetafile(metafile, { verbose: true }), ` - out.js ────── 100b ── 100.0% - ├ lib.js ──── 50b ─── 50.0% + out.js ────── 100B ── 100.0% + ├ lib.js ──── 50B ─── 50.0% │ └ entry.js - └ entry.js ── 25b ─── 25.0% + └ entry.js ── 25B ─── 25.0% `) }, } @@ -7192,15 +7192,15 @@ ${path.relative(process.cwd(), input).split(path.sep).join('/')}:1:2: ERROR: Une } } assert.strictEqual(esbuild.analyzeMetafileSync(metafile), ` - out.js 100b 100.0% - ├ lib.js 50b 50.0% - └ entry.js 25b 25.0% + out.js 100B 100.0% + ├ lib.js 50B 50.0% + └ entry.js 25B 25.0% `) assert.strictEqual(esbuild.analyzeMetafileSync(metafile, { verbose: true }), ` - out.js ────── 100b ── 100.0% - ├ lib.js ──── 50b ─── 50.0% + out.js ────── 100B ── 100.0% + ├ lib.js ──── 50B ─── 50.0% │ └ entry.js - └ entry.js ── 25b ─── 25.0% + └ entry.js ── 25B ─── 25.0% `) }, }