chore(HowThisWasMadeSectionView): Make some fields optional

Just in case.
This commit is contained in:
Luan
2024-12-14 12:41:24 -03:00
parent e95402731e
commit 0b73702bdd

View File

@@ -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);
}
}