MCPcopy Create free account
hub / github.com/Y80/bmm / createBookmarkHostCheckFilter

Function createBookmarkHostCheckFilter

src/controllers/BookmarkHostCheck.controller.ts:69–86  ·  view source on GitHub ↗
(
  table: { hostKey: any },
  status: BookmarkHostCheckFilterStatus
)

Source from the content-addressed store, hash-verified

67}
68
69export 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
88export async function withBookmarkHostCheckSummaries<T extends BookmarkWithHostKey>(
89 list: T[]

Callers 2

createFindManyFiltersFunction · 0.90
createFindManyFiltersFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected