MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / decodeCursor

Function decodeCursor

packages/trpc/src/routers/session.ts:20–33  ·  view source on GitHub ↗
(
  encoded: string
)

Source from the content-addressed store, hash-verified

18}
19
20export function decodeCursor(
21 encoded: string
22): { createdAt: string; id: string } | null {
23 try {
24 const json = Buffer.from(encoded, 'base64url').toString('utf8');
25 const obj = JSON.parse(json);
26 if (typeof obj.createdAt === 'string' && typeof obj.id === 'string') {
27 return obj;
28 }
29 return null;
30 } catch {
31 return null;
32 }
33}
34
35export const sessionRouter = createTRPCRouter({
36 list: protectedProcedure

Callers

nothing calls this directly

Calls 3

parseMethod · 0.80
toStringMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected