mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 16:18:51 +00:00
chore(HowThisWasMadeSectionView): Make some fields optional
Just in case.
This commit is contained in:
@@ -5,14 +5,17 @@ import Text from './misc/Text.js';
|
||||
export default class HowThisWasMadeSectionView extends YTNode {
|
||||
static type = 'HowThisWasMadeSectionView';
|
||||
|
||||
public section_title: Text;
|
||||
public body_text: Text;
|
||||
public body_header: Text;
|
||||
public section_title?: Text;
|
||||
public body_text?: Text;
|
||||
public body_header?: Text;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.section_title = Text.fromAttributed(data.sectionText);
|
||||
this.body_text = Text.fromAttributed(data.bodyText);
|
||||
this.body_header = Text.fromAttributed(data.bodyHeader);
|
||||
if (Reflect.has(data, 'sectionText'))
|
||||
this.section_title = Text.fromAttributed(data.sectionText);
|
||||
if (Reflect.has(data, 'bodyText'))
|
||||
this.body_text = Text.fromAttributed(data.bodyText);
|
||||
if (Reflect.has(data, 'bodyHeader'))
|
||||
this.body_header = Text.fromAttributed(data.bodyHeader);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user