From 394df06ac38fced2bcb91df6389a2028c3a0c95f Mon Sep 17 00:00:00 2001 From: Yuhei Yasuda Date: Tue, 19 Aug 2025 12:50:06 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=83=91?= =?UTF-8?q?=E3=83=83=E3=82=B1=E3=83=BC=E3=82=B8=E8=A8=AD=E5=AE=9A=E3=82=92?= =?UTF-8?q?=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E5=BD=A2?= =?UTF-8?q?=E5=BC=8F=E3=81=AB=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配列形式からObject.entries()を使用したオブジェクト形式に変更し、 コードの可読性を向上させた。 --- scripts/config.ts | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index 9e01963..82d61ae 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -20,25 +20,15 @@ export const rootDirectoryPath = path.join(import.meta.dirname, '..'); export const userPackageNameMap = new Map(); // TODO: set the display name of the user packages -// prettier-ignore -for (const [directoryPath, name] of [ - [ - '../user-repositories/internal-library-reference-stats-user-a/systems/plum/packages/front', +for (const [directoryPath, name] of Object.entries({ + '../user-repositories/internal-library-reference-stats-user-a/systems/plum/packages/front': '梅', - ], - [ - '../user-repositories/internal-library-reference-stats-user-a/systems/shiratama/packages/front', + '../user-repositories/internal-library-reference-stats-user-a/systems/shiratama/packages/front': '白玉', - ], - [ - '../user-repositories/internal-library-reference-stats-user-a/systems/vinegar/packages/front', + '../user-repositories/internal-library-reference-stats-user-a/systems/vinegar/packages/front': '酢', - ], - [ - '../user-repositories/internal-library-reference-stats-user-b', - 'User B', - ], -] satisfies [string, string][]) { + '../user-repositories/internal-library-reference-stats-user-b': 'User B', +})) { const absolutePath = path.join(import.meta.dirname, directoryPath); userPackageNameMap.set(absolutePath, name); }