From 05e00e4c2b169371ec5cab4e8347798c1cb2a986 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Tue, 23 Jun 2026 15:01:19 +0900 Subject: [PATCH] refactor(dev): refactor frontend-js-size.mjs --- .github/scripts/frontend-js-size.mjs | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/scripts/frontend-js-size.mjs b/.github/scripts/frontend-js-size.mjs index da856aacfa..2cbe68b413 100644 --- a/.github/scripts/frontend-js-size.mjs +++ b/.github/scripts/frontend-js-size.mjs @@ -365,21 +365,6 @@ function renderVisualizerSummaryTable(before, after) { ]; } -function commonChunkKeys(before, after) { - return Object.keys(before.chunks) - .filter((key) => after.chunks[key] != null); -} - -function addedChunkKeys(before, after) { - return Object.keys(after.chunks) - .filter((key) => before.chunks[key] == null); -} - -function removedChunkKeys(before, after) { - return Object.keys(before.chunks) - .filter((key) => after.chunks[key] == null); -} - function getChunkComparisonRows(keys, before, after) { return keys.map((key) => { const beforeEntry = before.chunks[key]; @@ -441,11 +426,13 @@ function chunkMarkdownTable(rows, total) { } function renderFrontendChunkReport(before, after) { - const commonChunkKeys = commonChunkKeys(before, after); + const commonChunkKeys = Object.keys(before.chunks).filter((key) => after.chunks[key] != null); + const addedChunkKeys = Object.keys(after.chunks).filter((key) => before.chunks[key] == null); + const removedChunkKeys = Object.keys(before.chunks).filter((key) => after.chunks[key] == null); const allChunkKeys = [ ...commonChunkKeys, - ...addedChunkKeys(before, after), - ...removedChunkKeys(before, after), + ...addedChunkKeys, + ...removedChunkKeys, ]; //const comparisonRows = getChunkComparisonRows(commonChunkKeys, before, after); const allComparisonRows = getChunkComparisonRows(allChunkKeys, before, after);