chore: formattato il codice e rimosso un vecchio file

This commit is contained in:
2023-01-10 01:36:29 +01:00
parent 476c0b4a71
commit 2901a1f899
7 changed files with 41 additions and 61 deletions
+1 -6
View File
@@ -22,12 +22,7 @@ export function sortByNumericKey<T>(items: T[], keyFn: KeyFn<T, number>, ascendi
return sortByKey(compareNumberKeys, items, keyFn, ascending)
}
function sortByKey<T, K>(
compareFn: (a: K, b: K) => number,
items: T[],
keyFn: (item: T) => K,
ascending: boolean
) {
function sortByKey<T, K>(compareFn: (a: K, b: K) => number, items: T[], keyFn: (item: T) => K, ascending: boolean) {
const sortedList = [...items]
const order = ascending ? 1 : -1
sortedList.sort((a, b) => order * compareFn(keyFn(a), keyFn(b)))