File size: 260 Bytes
e4e0e54
 
 
 
 
 
 
1
2
3
4
5
6
7
import { Video } from "../types.mts"

// used by the API, to return latest videos at the top
export function sortVideosByYoungestFirst(videos: Video[]) {
  videos.sort((a: Video, b: Video) => Date.parse(b.createdAt) - Date.parse(a.createdAt))
  return videos
}