feat: services table with dnd
This commit is contained in:
10
src/utils/lexorank/sort.ts
Normal file
10
src/utils/lexorank/sort.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { compareByLexorankWithKey } from "@/utils/lexorank/compare";
|
||||
import { LexorankSortable } from "@/utils/lexorank/types";
|
||||
|
||||
export function sortByLexorank<T extends LexorankSortable>(items: T[]): T[] {
|
||||
return sortByLexorankWithKey(items, "lexorank");
|
||||
}
|
||||
|
||||
export function sortByLexorankWithKey<T>(items: T[], key: keyof T): T[] {
|
||||
return items.sort((a, b) => compareByLexorankWithKey(a, b, key));
|
||||
}
|
||||
Reference in New Issue
Block a user