]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/lib/actor-image.ts
Update translations
[github/Chocobozzz/PeerTube.git] / server / lib / actor-image.ts
1 import maxBy from 'lodash/maxBy'
2
3 function getBiggestActorImage <T extends { width: number }> (images: T[]) {
4 const image = maxBy(images, 'width')
5
6 // If width is null, maxBy won't return a value
7 if (!image) return images[0]
8
9 return image
10 }
11
12 export {
13 getBiggestActorImage
14 }