refactor: simplify code
This commit is contained in:
parent
1c0a889d97
commit
44d04f1364
1 changed files with 10 additions and 13 deletions
|
|
@ -524,20 +524,17 @@ page_container %}
|
|||
blindingFactor: t.B_,
|
||||
denomination: t.amount
|
||||
}))
|
||||
console.log('### x1', x)
|
||||
x.forEach(t => {
|
||||
y[`_${t.denomination}`] = y[`_${t.denomination}`] || []
|
||||
y[`_${t.denomination}`].push(t)
|
||||
})
|
||||
x = Object.keys(y).map(k => ({
|
||||
denomination: y[k][0].denomination,
|
||||
count: y[k].length,
|
||||
value: y[k][0].denomination * y[k].length
|
||||
}))
|
||||
console.log('### x2', x)
|
||||
console.log('### y', y)
|
||||
.reduce((y, t) => {
|
||||
y[`_${t.denomination}`] = y[`_${t.denomination}`] || []
|
||||
y[`_${t.denomination}`].push(t)
|
||||
return y
|
||||
}, {})
|
||||
|
||||
return x
|
||||
return Object.keys(x).map(k => ({
|
||||
denomination: x[k][0].denomination,
|
||||
count: x[k].length,
|
||||
value: x[k][0].denomination * x[k].length
|
||||
}))
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue