From fcb19ab8e2989e3e2f5b855ec7768a1e0e392d8f Mon Sep 17 00:00:00 2001 From: Mogyuchi Date: Thu, 25 Jul 2024 18:15:17 +0900 Subject: [PATCH] refactor: remove filter HACK (#154) --- dist/index.js | 4 +--- src/main.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 153967e..008618c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29336,9 +29336,7 @@ async function run() { ? [(0, ref_1.getRef)({ eventName, payload })].flatMap(x => x ? x : infoNull(eventName)) : branchNames .map(branchName => (0, utils_1.convertRef)(branchName, { refType: 'branch' })) - // .filter(Boolean) // この時代のfilterの型定義って終わってたのか… - // HACK - .flatMap(x => (x ? x : [])); + .filter(ref => ref !== null); for (const ref of refs) { await deleteRefActionsCaches(octokit, repo, ref, isDryRun); } diff --git a/src/main.ts b/src/main.ts index 8bf6bae..2a4622d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -73,9 +73,7 @@ export async function run(): Promise { ) : branchNames .map(branchName => convertRef(branchName, { refType: 'branch' })) - // .filter(Boolean) // この時代のfilterの型定義って終わってたのか… - // HACK - .flatMap(x => (x ? x : [])) + .filter(ref => ref !== null) for (const ref of refs) { await deleteRefActionsCaches(octokit, repo, ref, isDryRun)