package com.convenient.android.common.extension

import com.convenient.android.common.media.config.MediaSortOrder
import com.convenient.android.common.media.config.SortUtils

/**
 * @classname:
 * @author: LiuXiaoLong
 * @date: 2022/8/4
 * description:
 */

/**
 * 排序扩展方法
 */
fun <T, R : Comparable<R>> List<T>.sort(order: MediaSortOrder, selector: (T) -> R?) : List<T>{
    return SortUtils.sort(order, data = this, selector = selector).toList()
}