Files
YouTube.js/src/parser/classes/MusicDescriptionShelf.ts
LuanRT 257bd475a0 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
2023-04-23 06:37:33 -03:00

27 lines
690 B
TypeScript

import Text from './misc/Text.js';
import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
export default class MusicDescriptionShelf extends YTNode {
static type = 'MusicDescriptionShelf';
description: Text;
max_collapsed_lines?: string;
max_expanded_lines?: string;
footer: Text;
constructor(data: RawNode) {
super();
this.description = new Text(data.description);
if (Reflect.has(data, 'maxCollapsedLines')) {
this.max_collapsed_lines = data.maxCollapsedLines;
}
if (Reflect.has(data, 'maxExpandedLines')) {
this.max_expanded_lines = data.maxExpandedLines;
}
this.footer = new Text(data.footer);
}
}