(state: CursorState)
| 508 | } |
| 509 | |
| 510 | function encodeCursor(state: CursorState): string { |
| 511 | return Buffer.from(JSON.stringify(state), 'utf8').toString('base64url') |
| 512 | } |
| 513 | |
| 514 | function decodeCursor(cursor: string | undefined, initialPhase: SyncPhase): CursorState { |
| 515 | if (!cursor) return { phase: initialPhase, issuePage: 1 } |