feat: board creation and actions dropdown
This commit is contained in:
@ -21,6 +21,15 @@ export function sortByLexorank<T extends LexorankSortable>(items: T[]): T[] {
|
||||
return items.sort(compareByLexorank);
|
||||
}
|
||||
|
||||
export function getMaxByLexorank<T extends LexorankSortable>(
|
||||
items: T[]
|
||||
): T | null {
|
||||
return items.reduce(
|
||||
(max, item) => (!max || item.lexorank > max.lexorank ? item : max),
|
||||
null as T | null
|
||||
);
|
||||
}
|
||||
|
||||
export function getNewLexorank(
|
||||
left?: LexoRank | null,
|
||||
right?: LexoRank | null
|
||||
|
||||
Reference in New Issue
Block a user