function decodeCursor
Since 0.2.0
decodeCursor(token: string): CursorPayload | null

Decode a cursor token to its CursorPayload, or null when the token is malformed.

A malformed token decodes to null and never throws — the caller branches on null and refuses by name, which keeps a corrupt cursor a refused request rather than an uncaught rejection off the public surface.

Parameters

token: string

A token previously returned by encodeCursor

Return Type

The decoded payload, or null when the token is not well-formed JSON

Usage

import { decodeCursor } from "common/src/index.ts";