MCPcopy Index your code
hub / github.com/simstudioai/sim / decodeCursor

Function decodeCursor

apps/sim/lib/logs/list-logs.ts:51–59  ·  view source on GitHub ↗
(cursor: string)

Source from the content-addressed store, hash-verified

49}
50
51export function decodeCursor(cursor: string): CursorData | null {
52 try {
53 const parsed = JSON.parse(Buffer.from(cursor, 'base64').toString())
54 if (typeof parsed?.id !== 'string') return null
55 return parsed as CursorData
56 } catch {
57 return null
58 }
59}
60
61/**
62 * Shared logs list query used by the `/api/logs` route and the copilot `query_logs`

Callers 2

list-logs.test.tsFile · 0.90
listLogsFunction · 0.70

Calls 2

parseMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected