From 308f897eb7b0676e972ca37176e1fb14dbf0524d Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Tue, 6 May 2025 04:20:29 -0400 Subject: [PATCH] update countDetail reducer --- src/artigen/utils/counter.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/artigen/utils/counter.ts b/src/artigen/utils/counter.ts index cff069f..55593ca 100644 --- a/src/artigen/utils/counter.ts +++ b/src/artigen/utils/counter.ts @@ -25,17 +25,17 @@ export const rollCounter = (rollSet: RollSet[]): CountDetails => { return countDetails; }; -export const reduceCountDetails = (counts: CountDetails[]): CountDetails => { - return counts.reduce( - (acc, cnt) => { +export const reduceCountDetails = (counts: CountDetails[]): CountDetails => + counts.reduce( + (acc, cur) => { loopCountCheck(); return { - total: acc.total + cnt.total, - successful: acc.successful + cnt.successful, - failed: acc.failed + cnt.failed, - rerolled: acc.rerolled + cnt.rerolled, - dropped: acc.dropped + cnt.dropped, - exploded: acc.exploded + cnt.exploded, + total: acc.total + cur.total, + successful: acc.successful + cur.successful, + failed: acc.failed + cur.failed, + rerolled: acc.rerolled + cur.rerolled, + dropped: acc.dropped + cur.dropped, + exploded: acc.exploded + cur.exploded, }; }, { @@ -47,4 +47,3 @@ export const reduceCountDetails = (counts: CountDetails[]): CountDetails => { exploded: 0, }, ); -};