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

Function encodeCursor

packages/trpc/src/routers/session.ts:12–18  ·  view source on GitHub ↗
(cursor: {
  createdAt: string;
  id: string;
})

Source from the content-addressed store, hash-verified

10import { createTRPCRouter, protectedProcedure } from '../trpc';
11
12export 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
20export function decodeCursor(
21 encoded: string

Callers

nothing calls this directly

Calls 3

stringifyMethod · 0.45
toStringMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected