Type should be a literal
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user