chore: formattato il codice e rimosso un vecchio file
This commit is contained in:
+2
-2
@@ -57,8 +57,8 @@ export type SolutionStatus = 'pending' | 'correct' | 'wrong'
|
||||
export type SolutionId = Id<Solution>
|
||||
|
||||
export type SolutionStat = {
|
||||
sentSolutionsCount: number,
|
||||
correctSolutionsCount: number,
|
||||
sentSolutionsCount: number
|
||||
correctSolutionsCount: number
|
||||
}
|
||||
|
||||
export type Solution = {
|
||||
|
||||
+1
-6
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user