FoundKey/packages/backend/src/misc/renote.ts
Michcio c282ed7683
Narrow type of isPureRenote
As side effect of that, a non-null assertion can be removed.

Co-authored-by: Johann150 <johann.galle@protonmail.com>
2022-10-30 17:38:56 +01:00

5 lines
310 B
TypeScript

import { Note } from '@/models/entities/note.js';
export function isPureRenote(note: Note): note is Note & { renoteId: string, text: null, fileIds: null | never[], hasPoll: false } {
return note.renoteId != null && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !note.hasPoll;
}