mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-27 16:48:55 +00:00
chore(parser): lint
This commit is contained in:
@@ -6,22 +6,23 @@ import Thumbnail from '../misc/Thumbnail.js';
|
||||
import { YTNode } from '../../helpers.js';
|
||||
import type { RawNode } from '../../index.js';
|
||||
|
||||
export type CustomEmoji = {
|
||||
emoji_id: string;
|
||||
shortcuts: string[];
|
||||
search_terms: string[];
|
||||
image: Thumbnail[];
|
||||
is_custom_emoji: boolean;
|
||||
}
|
||||
|
||||
export default class CommentsHeader extends YTNode {
|
||||
static type = 'CommentsHeader';
|
||||
|
||||
title: Text;
|
||||
count: Text;
|
||||
comments_count: Text;
|
||||
create_renderer;
|
||||
sort_menu: SortFilterSubMenu | null;
|
||||
|
||||
custom_emojis?: {
|
||||
emoji_id: string;
|
||||
shortcuts: string[];
|
||||
search_terms: string[];
|
||||
image: Thumbnail[];
|
||||
is_custom_emoji: boolean;
|
||||
}[];
|
||||
public title: Text;
|
||||
public count: Text;
|
||||
public comments_count: Text;
|
||||
public create_renderer;
|
||||
public sort_menu: SortFilterSubMenu | null;
|
||||
public custom_emojis?: CustomEmoji[];
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
@@ -32,15 +33,13 @@ export default class CommentsHeader extends YTNode {
|
||||
this.sort_menu = Parser.parseItem(data.sortMenu, SortFilterSubMenu);
|
||||
|
||||
if (Reflect.has(data, 'customEmojis')) {
|
||||
this.custom_emojis = data.customEmojis.map((emoji: RawNode) => {
|
||||
return {
|
||||
emoji_id: emoji.emojiId,
|
||||
shortcuts: emoji.shortcuts,
|
||||
search_terms: emoji.searchTerms,
|
||||
image: Thumbnail.fromResponse(emoji.image),
|
||||
is_custom_emoji: emoji.isCustomEmoji
|
||||
};
|
||||
});
|
||||
this.custom_emojis = data.customEmojis.map((emoji: RawNode) => ({
|
||||
emoji_id: emoji.emojiId,
|
||||
shortcuts: emoji.shortcuts,
|
||||
search_terms: emoji.searchTerms,
|
||||
image: Thumbnail.fromResponse(emoji.image),
|
||||
is_custom_emoji: emoji.isCustomEmoji
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user