refactor: clean up parser and tests (#387)

* tests: improve coverage

* refactor: clean up nodes

* chore: lint

* feat(parser): ignore `BrandVideoShelf`

Seems to be used for ads.

* feat(parser): ignore `BrandVideoSingleton` too
This commit is contained in:
LuanRT
2023-04-23 06:37:33 -03:00
committed by GitHub
parent f66f0bd656
commit 257bd475a0
358 changed files with 2823 additions and 3126 deletions

View File

@@ -2,16 +2,17 @@ import Parser from '../../index.js';
import Button from '../Button.js';
import ToggleButton from '../ToggleButton.js';
import CreatorHeart from './CreatorHeart.js';
import { YTNode } from '../../helpers.js';
import type { RawNode } from '../../index.js';
class CommentActionButtons extends YTNode {
export default class CommentActionButtons extends YTNode {
static type = 'CommentActionButtons';
like_button;
dislike_button;
reply_button;
creator_heart;
like_button: ToggleButton | null;
dislike_button: ToggleButton | null;
reply_button: Button | null;
creator_heart: CreatorHeart | null;
constructor(data: RawNode) {
super();
@@ -20,6 +21,4 @@ class CommentActionButtons extends YTNode {
this.reply_button = Parser.parseItem(data.replyButton, Button);
this.creator_heart = Parser.parseItem(data.creatorHeart, CreatorHeart);
}
}
export default CommentActionButtons;
}