Turns the rows the comment service reads from comments into the Comment the comment routes send.
f
commentRowToApi(row: CommentRow): Comment
Converts row to the Comment the comment routes send and the
WebSocket broadcasts.
f
isCommentRow(obj: unknown): obj is CommentRow
Checks whether a row node:sqlite returned is a CommentRow.
I
CommentRow
Returned by the comment service's SELECTs on comments, joined with
users for the author_ columns.
- author_avatar_mime: string | null
- author_username: string
- body: string
- created_at: string
-
deleted: number
1 once deleted. The body is emptied but the row stays, so its replies keep their place in the thread.
- dump_id: string
- id: string
- like_count: number
-
parent_id: string | null
It is null on a top-level comment.
- updated_at: string | null
- user_id: string
Usage
import * as mod from "api/model/comment.ts";