chore: simplify map

This commit is contained in:
Cory Dransfeldt 2023-10-21 13:41:38 -07:00
parent 4637a63042
commit 24d9a85457

View file

@ -38,7 +38,6 @@ module.exports = {
* @returns {Array} - a new array sorted by the number of plays in descending order.
*/
sortByPlays: (array) => Object.values(array).sort((a, b) => b.plays - a.plays).map((media, index) => {
media.rank = index + 1
return media
return media.rank = index + 1
}),
}