Skip to content

readDateCursor

function readDateCursor(cursor?: unknown): Date | undefined;

Read a date cursor as a Date.

Returns undefined rather than throwing for an absent, differently-typed, or unparseable cursor: a source meeting one of those is on its first run or is reading something an older version wrote, and should simply start from the beginning.

ParameterTypeDescription
cursor?unknownThe source’s previous cursor (ctx.cursor).

Date | undefined

The cursor date, or undefined when there is not a usable one.