mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 00:02:09 +00:00
* Prefer `c ? x : y` over `c && x || y` * Avoid unnecessary asssignment expressions * Prefer switch statements over object lookup tables * Add an .editorconfig * Fix style issues * Fix mentioned issues Co-authored-by: bob <bob.varioa@gmail.com>
29 lines
698 B
JavaScript
29 lines
698 B
JavaScript
'use strict';
|
|
|
|
const Parser = require('..');
|
|
|
|
class SectionList {
|
|
type = 'SectionList';
|
|
|
|
constructor(data) {
|
|
if (data.targetId) {
|
|
this.target_id = data.targetId;
|
|
}
|
|
|
|
this.contents = Parser.parse(data.contents);
|
|
|
|
if (data.continuations) {
|
|
if (data.continuations[0].nextContinuationData) {
|
|
this.continuation = data.continuations[0].nextContinuationData.continuation;
|
|
} else if (data.continuations[0].reloadContinuationData) {
|
|
this.continuation = data.continuations[0].reloadContinuationData.continuation;
|
|
}
|
|
}
|
|
|
|
if (data.header) {
|
|
this.header = Parser.parse(data.header);
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = SectionList; |