(code, filename)
| 32 | } |
| 33 | |
| 34 | async function getSizeInfo(code, filename) { |
| 35 | const raw = code.length < 5000 |
| 36 | const gzip = await gzipSize(code) |
| 37 | const brotli = await brotliSize(code) |
| 38 | const gzipLog = formatSize(gzip, filename, 'gz', raw) |
| 39 | const brotliLog = formatSize(brotli, filename, 'br', raw) |
| 40 | return { |
| 41 | size: formatBytes(gzip), |
| 42 | gzip: pretty(gzip, raw), |
| 43 | brotli: pretty(brotli, raw), |
| 44 | gzipLog, |
| 45 | brotliLog |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | module.exports = { |
| 50 | getSizeInfo |
no test coverage detected