mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
26 lines
563 B
JavaScript
26 lines
563 B
JavaScript
'use strict';
|
|
|
|
const Text = require('./Text');
|
|
const Parser = require('..');
|
|
const NavigationEndpoint = require('./NavigationEndpoint');
|
|
|
|
class Shelf {
|
|
type = 'shelfRenderer';
|
|
|
|
constructor(data) {
|
|
this.title = new Text(data.title);
|
|
|
|
data.endpoint &&
|
|
(this.endpoint = new NavigationEndpoint(data.endpoint));
|
|
|
|
this.content = Parser.parse(data.content) || [];
|
|
|
|
data.icon?.iconType &&
|
|
(this.icon_type = data.icon?.iconType);
|
|
|
|
data.menu &&
|
|
(this.menu = Parser.parse(data.menu));
|
|
}
|
|
}
|
|
|
|
module.exports = Shelf; |