Type should be a literal

This commit is contained in:
WardPearce
2026-03-05 01:25:03 +13:00
parent 0e687d185f
commit 40ab505dff
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -54,6 +54,7 @@ export function isItemFiltered(item: FeedItem): boolean {
return filteredContent.some((filterGroup) => {
if (filterGroup.type !== item.type) {
// Video is an alias for shortVideo & stream
if (filterGroup.type !== 'video' || (item.type !== 'shortVideo' && item.type !== 'stream')) {
return false;
}
+2 -2
View File
@@ -1,6 +1,6 @@
// Not possible to exact from typescript interfaces at runtime.
export const VideoSchema: Record<string, string> = {
export const VideoSchema: Record<string, string | string[]> = {
author: 'string',
authorId: 'string',
authorUrl: 'string',
@@ -8,7 +8,7 @@ export const VideoSchema: Record<string, string> = {
published: 'number',
publishedText: 'string',
title: 'string',
type: 'string',
type: ['video', 'shortVideo', 'stream'],
videoId: 'string',
viewCount: 'number',
viewCountText: 'string'