Skip to main content

Module cursor

Module cursor 

Source
Expand description

Keyset cursors (spec/surface/README.md §1.4): base64url(JSON [parts...]), one encoding for every paged surface — [path, id] for query, [path] for docs_list/docs_tree. Decoding requires exactly arity string parts; anything else is SurfaceError::cursor_invalid naming the surface.

Functions§

base64url_decode
Decode base64 or base64url, padding optional. None on a foreign byte.
base64url_encode
Unpadded base64url of bytes (Node’s Buffer#toString("base64url")).
decode_cursor
Decode a cursor issued by encode_cursor, requiring exactly arity string parts; surface names the caller for the error.
encode_cursor
Encode a keyset position as an opaque cursor.