chore: clean up & remove unneeded code (#265)

This commit is contained in:
LuanRT
2022-12-31 05:49:41 -03:00
committed by GitHub
parent 6a4b4f3359
commit 9ac5043309
47 changed files with 1056 additions and 872 deletions

View File

@@ -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);
}
}
}