mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 13:07:28 +00:00
chore: clean up & remove unneeded code (#265)
This commit is contained in:
@@ -5,19 +5,34 @@ import { YTNode } from '../../helpers';
|
||||
class CommentsEntryPointHeader extends YTNode {
|
||||
static type = 'CommentsEntryPointHeader';
|
||||
|
||||
header;
|
||||
comment_count;
|
||||
teaser_avatar;
|
||||
teaser_content;
|
||||
simplebox_placeholder;
|
||||
header?: Text;
|
||||
comment_count?: Text;
|
||||
teaser_avatar?: Thumbnail[];
|
||||
teaser_content?: Text;
|
||||
simplebox_placeholder?: Text;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.header = new Text(data.headerText);
|
||||
this.comment_count = new Text(data.commentCount);
|
||||
this.teaser_avatar = Thumbnail.fromResponse(data.teaserAvatar || data.simpleboxAvatar);
|
||||
this.teaser_content = new Text(data.teaserContent);
|
||||
this.simplebox_placeholder = new Text(data.simpleboxPlaceholder);
|
||||
|
||||
if (data.header) {
|
||||
this.header = new Text(data.headerText);
|
||||
}
|
||||
|
||||
if (data.commentCount) {
|
||||
this.comment_count = new Text(data.commentCount);
|
||||
}
|
||||
|
||||
if (data.teaserAvatar || data.simpleboxAvatar) {
|
||||
this.teaser_avatar = Thumbnail.fromResponse(data.teaserAvatar || data.simpleboxAvatar);
|
||||
}
|
||||
|
||||
if (data.teaserContent) {
|
||||
this.teaser_content = new Text(data.teaserContent);
|
||||
}
|
||||
|
||||
if (data.simpleboxPlaceholder) {
|
||||
this.simplebox_placeholder = new Text(data.simpleboxPlaceholder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user