(
table: { hostKey: any },
status: BookmarkHostCheckFilterStatus
)
| 67 | } |
| 68 | |
| 69 | export function createBookmarkHostCheckFilter( |
| 70 | table: { hostKey: any }, |
| 71 | status: BookmarkHostCheckFilterStatus |
| 72 | ) { |
| 73 | if (!status) return undefined |
| 74 | |
| 75 | const checkedHostKeys = db.select({ hostKey: bookmarkHostChecks.hostKey }).from(bookmarkHostChecks) |
| 76 | |
| 77 | if (status === 'unchecked') { |
| 78 | return or(isNull(table.hostKey), notInArray(table.hostKey, checkedHostKeys)) |
| 79 | } |
| 80 | |
| 81 | const targetHostKeys = db |
| 82 | .select({ hostKey: bookmarkHostChecks.hostKey }) |
| 83 | .from(bookmarkHostChecks) |
| 84 | .where(eq(bookmarkHostChecks.status, status)) |
| 85 | return and(inArray(table.hostKey, targetHostKeys)) |
| 86 | } |
| 87 | |
| 88 | export async function withBookmarkHostCheckSummaries<T extends BookmarkWithHostKey>( |
| 89 | list: T[] |
no outgoing calls
no test coverage detected