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

Function parseCheckHostsTaskValue

src/controllers/BookmarkHostCheck.controller.ts:221–240  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

219}
220
221function parseCheckHostsTaskValue(value: unknown): CheckHostsTaskValue | null {
222 if (!value || typeof value !== 'object') return null
223 const task = value as Partial<CheckHostsTaskValue>
224 if (
225 typeof task.startedAt !== 'string' ||
226 !(typeof task.finishedAt === 'string' || task.finishedAt === null) ||
227 typeof task.total !== 'number' ||
228 typeof task.checked !== 'number'
229 ) {
230 return null
231 }
232
233 return {
234 startedAt: task.startedAt,
235 finishedAt: task.finishedAt,
236 total: task.total,
237 checked: task.checked,
238 errorMessage: typeof task.errorMessage === 'string' ? task.errorMessage : null,
239 }
240}
241
242async function getPublicCheckHostsTask() {
243 const row = await db.query.siteConfigs.findFirst({

Callers 2

getPublicCheckHostsTaskFunction · 0.85
getUserCheckHostsTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected