Skip to main content
Version: Current

dateReviver

@rotorsoft/act-root


@rotorsoft/act-root / act/src / dateReviver

Function: dateReviver()

dateReviver(_key, value): unknown

Defined in: libs/act/src/utils.ts:139

Revive ISO-8601-shaped strings into Dates during JSON.parse.

For host applications that parse Act JSON themselves (an export file, a message forwarded by a webhook) and have no event schema at hand. It turns every timestamp-shaped string into a Date, including fields declared as z.string(). The framework doesn't use it: it converts only the fields an event's schema declares as z.date().

Parameters​

_key​

string

value​

unknown

Returns​

unknown