initial
This commit is contained in:
22
utils/parseWinsData.js
Normal file
22
utils/parseWinsData.js
Normal file
@@ -0,0 +1,22 @@
|
||||
export const parseWinsData = (winsArray, currency) => {
|
||||
if (!winsArray || winsArray.length === 0) return ;
|
||||
const totalWin = winsArray.reduce((total, [_, win]) => {
|
||||
return total + win;
|
||||
}, 0);
|
||||
const totalWinString = currency.getFormattedValue(totalWin);
|
||||
const wins = winsArray.map(([type, amount, map, lineIndex]) => {
|
||||
return {
|
||||
type,
|
||||
amount,
|
||||
amountString: currency.getFormattedValue(amount),
|
||||
lineSlotsIndexMap: map,
|
||||
lineIndex
|
||||
}
|
||||
})
|
||||
const result = {
|
||||
totalWin,
|
||||
totalWinString,
|
||||
wins
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user