mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 19:42:14 +00:00
* tests: improve coverage * refactor: clean up nodes * chore: lint * feat(parser): ignore `BrandVideoShelf` Seems to be used for ads. * feat(parser): ignore `BrandVideoSingleton` too
35 lines
947 B
TypeScript
35 lines
947 B
TypeScript
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
import Text from './misc/Text.js';
|
|
|
|
export default class SettingBoolean extends YTNode {
|
|
static type = 'SettingBoolean';
|
|
|
|
title?: Text;
|
|
summary?: Text;
|
|
enable_endpoint?: NavigationEndpoint;
|
|
disable_endpoint?: NavigationEndpoint;
|
|
item_id: string;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
if (Reflect.has(data, 'title')) {
|
|
this.title = new Text(data.title);
|
|
}
|
|
|
|
if (Reflect.has(data, 'summary')) {
|
|
this.summary = new Text(data.summary);
|
|
}
|
|
|
|
if (Reflect.has(data, 'enableServiceEndpoint')) {
|
|
this.enable_endpoint = new NavigationEndpoint(data.enableServiceEndpoint);
|
|
}
|
|
|
|
if (Reflect.has(data, 'disableServiceEndpoint')) {
|
|
this.disable_endpoint = new NavigationEndpoint(data.disableServiceEndpoint);
|
|
}
|
|
|
|
this.item_id = data.itemId;
|
|
}
|
|
} |