diff --git a/src/utils/media.js b/src/utils/media.js index bdf1f0c4..0c17915f 100644 --- a/src/utils/media.js +++ b/src/utils/media.js @@ -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 + }), }