Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
sibljon committed Sep 11, 2024
1 parent fbfb27f commit 6b4b48c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,13 @@ export async function run(): Promise<void> {
});
const reviews = reviewsData.data;

const latestReviews = (reviews ?? []).reduce(
(acc, review) => {
if (!review.user) {
return acc;
}
acc[review.user.login] = review;
const latestReviews = (reviews ?? []).reduce((acc, review) => {
if (!review.user) {
return acc;
},
{} as Record<string, (typeof reviews)[number]>
);
}
acc[review.user.login] = review;
return acc;
}, {} as Record<string, typeof reviews[number]>);

const latestReviewsArray = Object.values(latestReviews || {});
core.info(`🔍 latestReviewsArray: ${JSON.stringify(latestReviewsArray)}`);
Expand Down

0 comments on commit 6b4b48c

Please sign in to comment.