Format message

This commit is contained in:
Sidharth Vinod
2024-01-24 22:12:33 +05:30
parent bea76aa682
commit f354d68350

View File

@@ -56,18 +56,21 @@ const main = async () => {
const oldStats = await readStats('./cypress/snapshots/stats/base/**/*.json'); const oldStats = await readStats('./cypress/snapshots/stats/base/**/*.json');
const newStats = await readStats('./cypress/snapshots/stats/head/**/*.json'); const newStats = await readStats('./cypress/snapshots/stats/head/**/*.json');
const diff = Object.entries(newStats) const diff = Object.entries(newStats)
.filter(([, value]) => value > 2048)
.map(([key, value]) => { .map(([key, value]) => {
const oldValue = oldStats[key]; const oldValue = oldStats[key];
const delta = value - oldValue; const delta = value - oldValue;
return [ const output = [
key, key,
formatSize(oldValue), formatSize(oldValue),
formatSize(value), formatSize(value),
formatSize(delta), formatSize(delta),
percentageDifference(oldValue, value), percentageDifference(oldValue, value),
].map((v) => v.toString()); ];
console.log(output);
return output;
}) })
.filter(([, , , delta]) => delta !== '0'); .filter(([, , , delta]) => delta !== '0 Bytes');
if (diff.length === 0) { if (diff.length === 0) {
console.log('No changes in bundle sizes'); console.log('No changes in bundle sizes');
return; return;