refactor: migrate to nuxt compatibilityVersion: 4 (#3298)
This commit is contained in:
parent
46e4433e1c
commit
a3fbc056a9
342 changed files with 1200 additions and 2932 deletions
|
@ -1,20 +0,0 @@
|
|||
import type { mastodon } from 'masto'
|
||||
import { NOTIFICATION_FILTER_TYPES } from '~/constants'
|
||||
|
||||
/**
|
||||
* Typeguard to check if an object is a valid notification filter
|
||||
* @param obj the object to be checked
|
||||
* @returns boolean and assigns type to object if true
|
||||
*/
|
||||
export function isNotificationFilter(obj: unknown): obj is mastodon.v1.NotificationType {
|
||||
return !!obj && NOTIFICATION_FILTER_TYPES.includes(obj as unknown as mastodon.v1.NotificationType)
|
||||
}
|
||||
|
||||
/**
|
||||
* Typeguard to check if an object is a valid notification
|
||||
* @param obj the object to be checked
|
||||
* @returns boolean and assigns type to object if true
|
||||
*/
|
||||
export function isNotification(obj: unknown): obj is mastodon.v1.NotificationType {
|
||||
return !!obj && ['mention', ...NOTIFICATION_FILTER_TYPES].includes(obj as unknown as mastodon.v1.NotificationType)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue