mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-20 04:51:16 +00:00
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:
@@ -1,17 +1,16 @@
|
||||
import Text from './misc/Text.js';
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
|
||||
class MetadataRow extends YTNode {
|
||||
export default class MetadataRow extends YTNode {
|
||||
static type = 'MetadataRow';
|
||||
|
||||
title;
|
||||
contents;
|
||||
title: Text;
|
||||
contents: Text[];
|
||||
|
||||
constructor(data: any) {
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = new Text(data.title);
|
||||
this.contents = (data.contents as any[]).map((content) => new Text(content));
|
||||
this.contents = data.contents.map((content: RawNode) => new Text(content));
|
||||
}
|
||||
}
|
||||
|
||||
export default MetadataRow;
|
||||
}
|
||||
Reference in New Issue
Block a user