orderDescending not needed with SortedMap

This commit is contained in:
Martti Malmi
2024-02-02 14:58:03 +02:00
parent cdd814cf73
commit 1fd37a42d2
4 changed files with 3 additions and 8 deletions

View File

@ -289,10 +289,6 @@ export const delay = (t: number) => {
});
};
export function orderDescending<T>(arr: Array<T & { created_at: number }>) {
return arr.sort((a, b) => (b.created_at > a.created_at ? 1 : -1));
}
export function orderAscending<T>(arr: Array<T & { created_at: number }>) {
return arr.sort((a, b) => (b.created_at > a.created_at ? -1 : 1));
}