style(frontend): prettier baseline format (no logic change)
This commit is contained in:
@@ -8,7 +8,8 @@ export type GroupMode = "flat" | "dir";
|
||||
export function sortBooks(books: Book[], key: SortKey): Book[] {
|
||||
const a = [...books];
|
||||
if (key === "title") return a.sort((x, y) => x.title.localeCompare(y.title, "zh"));
|
||||
if (key === "progress") return a.sort((x, y) => y.percent - x.percent || (x.added_at < y.added_at ? 1 : x.added_at > y.added_at ? -1 : 0));
|
||||
if (key === "progress")
|
||||
return a.sort((x, y) => y.percent - x.percent || (x.added_at < y.added_at ? 1 : x.added_at > y.added_at ? -1 : 0));
|
||||
return a.sort((x, y) => (x.added_at < y.added_at ? 1 : x.added_at > y.added_at ? -1 : 0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user