support login data

This commit is contained in:
Julian Freeman
2026-04-16 22:43:17 -04:00
parent a976dc3fc5
commit 9fe16cd334
11 changed files with 519 additions and 20 deletions

View File

@@ -3,6 +3,8 @@ import type {
BookmarkSummary,
ExtensionSortKey,
ExtensionSummary,
PasswordSiteSortKey,
PasswordSiteSummary,
AssociatedProfileSortKey,
AssociatedProfileSummary,
BookmarkAssociatedProfileSummary,
@@ -76,6 +78,16 @@ export function sortBookmarks(items: BookmarkSummary[], sortKey: BookmarkSortKey
});
}
export function sortPasswordSites(items: PasswordSiteSummary[], sortKey: PasswordSiteSortKey) {
const passwordSites = [...items];
return passwordSites.sort((left, right) => {
if (sortKey === "url") {
return compareOptionalText(left.url, right.url) || compareText(left.domain, right.domain);
}
return compareOptionalText(left.domain, right.domain) || compareText(left.url, right.url);
});
}
export function sortAssociatedProfiles(
items: (AssociatedProfileSummary | BookmarkAssociatedProfileSummary)[],
sortKey: AssociatedProfileSortKey,