Function
encodeCursor
(cursor: {
createdAt: string;
id: string;
})
Source from the content-addressed store, hash-verified
| 10 | import { createTRPCRouter, protectedProcedure } from '../trpc'; |
| 11 | |
| 12 | export function encodeCursor(cursor: { |
| 13 | createdAt: string; |
| 14 | id: string; |
| 15 | }): string { |
| 16 | const json = JSON.stringify(cursor); |
| 17 | return Buffer.from(json, 'utf8').toString('base64url'); // URL-safe |
| 18 | } |
| 19 | |
| 20 | export function decodeCursor( |
| 21 | encoded: string |
Callers
nothing calls this directly
Tested by
no test coverage detected