import { compareByLexorankWithKey } from "@/utils/lexorank/compare"; import { LexorankSortable } from "@/utils/lexorank/types"; export function sortByLexorank(items: T[]): T[] { return sortByLexorankWithKey(items, "lexorank"); } export function sortByLexorankWithKey(items: T[], key: keyof T): T[] { return items.sort((a, b) => compareByLexorankWithKey(a, b, key)); }