From d6b5c142117dae8b413855c227d8e2abab05606d Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Thu, 12 Jun 2025 21:34:44 -0400 Subject: [PATCH] Fix minify-assets CI comment to handle the case where a package has been removed --- bin/minify-assets.mjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/minify-assets.mjs b/bin/minify-assets.mjs index efbd97f1e0c..b17761e82f1 100644 --- a/bin/minify-assets.mjs +++ b/bin/minify-assets.mjs @@ -67,15 +67,15 @@ let packageData = { }; function totalMin(dataset) { - return dataset.reduce((a, b) => a + b[1], 0); + return dataset.reduce((a, b) => a + (b[1] || 0), 0); } function totalGz(dataset) { - return dataset.reduce((a, b) => a + b[2], 0); + return dataset.reduce((a, b) => a + (b[2] || 0), 0); } // function totalBr(dataset) { -// return dataset.reduce((a, b) => a + b[3], 0); +// return dataset.reduce((a, b) => a + (b[3] || 0), 0); // } import { buildMacros } from '@embroider/macros/babel'; @@ -196,9 +196,9 @@ printTable([ ], ...packageData.ember.map((x) => [ x[0].replace('@ember/', ''), - size(x[1]), - size(x[2]), - // size(x[3]), + size(x[1] || 0), + size(x[2] || 0), + // size(x[3] || 0), ]), ]); @@ -212,8 +212,8 @@ printTable([ ], ...packageData.glimmer.map((x) => [ x[0].replace('@glimmer/', ''), - size(x[1]), - size(x[2]), - // size(x[3]), + size(x[1] || 0), + size(x[2] || 0), + // size(x[3] || 0), ]), ]);