Skip to content

idSetCursor

function idSetCursor(values: readonly string[], max?: number): {
max?: number;
type: "idSet";
values: readonly string[];
};

Build a typed idSet cursor: deduped, bounded to max entries, and then bounded again to MAX_ID_SET_BYTES so the cursor the platform stores cannot be refused.

ParameterTypeDefault valueDescription
valuesreadonly string[]undefinedIds or URLs seen so far, oldest first, newest last. Order is load-bearing: it is what decides which entries survive eviction.
maxnumberDEFAULT_ID_SET_MAXCap on retained entries (default DEFAULT_ID_SET_MAX).
{
max?: number;
type: "idSet";
values: readonly string[];
}

The cursor to return from sync, carrying the numeric cap that was applied — Trove’s reader keeps max only when it is a number, and projects it as the set’s capacity so a feed can report itself at capacity.

NameType
max?number
type"idSet"
valuesreadonly string[]