From 655f7a8dfcd458d90740bfb0472454b07f996d05 Mon Sep 17 00:00:00 2001 From: Michcio Date: Sun, 25 Sep 2022 15:33:29 +0200 Subject: [PATCH] Narrow type of isPureRenote --- packages/backend/src/misc/renote.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/misc/renote.ts b/packages/backend/src/misc/renote.ts index 015c26d65..758dcdd05 100644 --- a/packages/backend/src/misc/renote.ts +++ b/packages/backend/src/misc/renote.ts @@ -1,5 +1,5 @@ import { Note } from '@/models/entities/note.js'; -export function isPureRenote(note: Note): boolean { +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; }