use isNotNull

This commit is contained in:
taichan 2024-02-20 15:44:13 +09:00
parent 823b7c3269
commit 7c9bacbbd8
No known key found for this signature in database
GPG Key ID: CCE28623AFA24E9C
1 changed files with 1 additions and 1 deletions

View File

@ -353,7 +353,7 @@ export class NotificationEntityService implements OnModuleInit {
const filteredNotifications = ((await Promise.all(notifications.map(async (notification) => { const filteredNotifications = ((await Promise.all(notifications.map(async (notification) => {
const isValid = await this.#validateNotifier(notification, meId, userIdsWhoMeMuting, userMutedInstances); const isValid = await this.#validateNotifier(notification, meId, userIdsWhoMeMuting, userMutedInstances);
return isValid ? notification : null; return isValid ? notification : null;
}))) as [T|null] ).filter((notification): notification is T => notification !== null); }))) as [T|null] ).filter(isNotNull);
return filteredNotifications; return filteredNotifications;
} }