Turns the rows of chat_messages into the ChatMessage the API sends. Only services/chat-service.ts uses it, on the rows of its one query.

Functions

f
chatMessageRowToApi(row: ChatMessageRow): ChatMessage

Converts a row to the ChatMessage that chat-service returns, turning its timestamps into Dates and its nulls into absent fields.

f
isChatMessageRow(obj: unknown): obj is ChatMessageRow

Checks whether obj, a row read by chat-service, is a ChatMessageRow.

Interfaces

I
ChatMessageRow

Returned by chat-service's query, which joins each message to its author and to the message it replies to. reply_to_id is kept when the message it points to is deleted, while reply_to_author and reply_to_body then read null.