(newSize, masterSize)
| 24 | } |
| 25 | |
| 26 | function showDiff(newSize, masterSize) { |
| 27 | const diffBytes = newSize - masterSize; |
| 28 | const diffPercent = (100 * diffBytes / masterSize).toFixed(2); |
| 29 | const sign = diffBytes > 0 ? '+' : ''; |
| 30 | |
| 31 | const charWidth = 7; |
| 32 | const diffKiloBytes = |
| 33 | (sign + (diffBytes / 1024).toFixed(2)).padStart(charWidth, ' '); |
| 34 | const masterKiloBytes = |
| 35 | ((masterSize / 1024).toFixed(2)).padStart(charWidth, ' '); |
| 36 | const newKiloBytes = ((newSize / 1024).toFixed(2)).padStart(charWidth, ' '); |
| 37 | |
| 38 | console.log(` diff: ${diffKiloBytes} K (${sign}${diffPercent}%)`); |
| 39 | console.log(` master: ${masterKiloBytes} K`); |
| 40 | console.log(` change: ${newKiloBytes} K`); |
| 41 | } |
| 42 | |
| 43 | exports.getFileSizeBytes = getFileSizeBytes; |
| 44 | exports.showDiff = showDiff; |
no test coverage detected
searching dependent graphs…