mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-25 15:52:13 +00:00
refactor(Parser)!: general refactoring of parsers (#344)
* refactor: move common info into MediaInfo * refactor: better inference on Memo * refactor: improved typesafety in parser methods * refactor: remove PlaylistAuthor in favor of Author * refactor: cleanup live chat parsers - Replace non standard author type with Author class - Remove redundant code * fix: new errors due to changes * fix: pass actions to FormatUtils#toDash * refactor!: merge NavigatableText and Text into single class
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Parser from '../index.js';
|
||||
import type Chapter from './Chapter.js';
|
||||
import type Heatmap from './Heatmap.js';
|
||||
import Chapter from './Chapter.js';
|
||||
import Heatmap from './Heatmap.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
|
||||
import { observe, ObservedArray, YTNode } from '../helpers.js';
|
||||
@@ -21,11 +21,11 @@ class Marker extends YTNode {
|
||||
this.value = {};
|
||||
|
||||
if (data.value.heatmap) {
|
||||
this.value.heatmap = Parser.parseItem<Heatmap>(data.value.heatmap);
|
||||
this.value.heatmap = Parser.parseItem(data.value.heatmap, Heatmap);
|
||||
}
|
||||
|
||||
if (data.value.chapters) {
|
||||
this.value.chapters = Parser.parseArray<Chapter>(data.value.chapters);
|
||||
this.value.chapters = Parser.parseArray(data.value.chapters, Chapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user