mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
16 lines
400 B
TypeScript
16 lines
400 B
TypeScript
type MaybeArchivedComment = {
|
|||
|
|
archived?: boolean;
|
||
|
|
commentModeration?: {
|
||
|
|
archived?: boolean;
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
export const isCommentArchived = (comment: unknown): boolean => {
|
||
|
|
if (!comment || typeof comment !== 'object') {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
const archivedComment = comment as MaybeArchivedComment;
|
||
|
|
return Boolean(archivedComment.archived || archivedComment.commentModeration?.archived);
|
||
|
|
};
|