fix: map + subtext

This commit is contained in:
Cory Dransfeldt 2023-10-21 14:04:50 -07:00
parent 24d9a85457
commit 5399324bba

View file

@ -37,7 +37,11 @@ module.exports = {
* @param {Array} array - an array of media objects.
* @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) => {
return media.rank = index + 1
}),
sortByPlays: (array) =>
Object.values(array)
.sort((a, b) => b.plays - a.plays)
.map((media, index) => {
media.rank = index + 1
return media
}),
}