decodeBase64Url
function decodeBase64Url(token): string;Defined in: cursor-codec.ts:98
Decode a base64url (or plain base64) string back to UTF-8. Missing =
padding is fine. The default decoder of createCursorCodec; throws on
input that isn’t base64.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
token |
string |
Returns
Section titled “Returns”string
Example
Section titled “Example”import { decodeBase64Url } from "@xtandard/lib/pagination";
decodeBase64Url("eyJpZCI6N30"); // '{"id":7}'decodeBase64Url("eyJpZCI6N30="); // '{"id":7}' (padded base64 works too)decodeBase64Url("Y2Fmw6kg4piV"); // "café ☕"