refactor: improve Search parser (#247)

* refactor: improve Search parser

* chore: lint
This commit is contained in:
LuanRT
2022-11-29 03:50:17 -03:00
committed by GitHub
parent 6caa679df6
commit 516eeeff45
11 changed files with 53 additions and 75 deletions

View File

@@ -3,7 +3,7 @@ import Text from './misc/Text';
import NavigationEndpoint from './NavigationEndpoint';
import { YTNode } from '../helpers';
class VerticalWatchCardList extends YTNode {
export default class VerticalWatchCardList extends YTNode {
static type = 'VerticalWatchCardList';
items;
@@ -13,11 +13,9 @@ class VerticalWatchCardList extends YTNode {
constructor(data: any) {
super();
this.items = Parser.parse(data.items);
this.items = Parser.parseArray(data.items);
this.contents = this.items; // XXX: alias for consistency
this.view_all_text = new Text(data.viewAllText);
this.view_all_endpoint = new NavigationEndpoint(data.viewAllEndpoint);
}
}
export default VerticalWatchCardList;
}