MCPcopy Create free account
hub / github.com/simstudioai/sim / decodeCursor

Function decodeCursor

apps/sim/connectors/monday/monday.ts:85–97  ·  view source on GitHub ↗
(cursor?: string)

Source from the content-addressed store, hash-verified

83}
84
85function decodeCursor(cursor?: string): CursorState {
86 if (!cursor) return { boardIndex: 0 }
87 try {
88 const json = Buffer.from(cursor, 'base64url').toString('utf8')
89 const parsed = JSON.parse(json) as Partial<CursorState>
90 return {
91 boardIndex: Number(parsed.boardIndex) || 0,
92 itemsCursor: typeof parsed.itemsCursor === 'string' ? parsed.itemsCursor : undefined,
93 }
94 } catch {
95 return { boardIndex: 0 }
96 }
97}
98
99/**
100 * monday.com uses the raw access token in the `Authorization` header — it is NOT

Callers 1

monday.tsFile · 0.70

Calls 2

parseMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected