refactor!: rewrite Analytics to TypeScript (#122)

* refactor: migrate all analytics’ classes to TypeScript

Also, add AnalyticsShortsCarouselCard and AnalyticsRoot.
This commit is contained in:
LuanRT
2022-07-29 05:39:34 -03:00
committed by GitHub
parent 5a99190136
commit adae925367
15 changed files with 221 additions and 72 deletions

View File

@@ -36,6 +36,11 @@ class NavigationEndpoint extends YTNode {
constructor(data: any) {
super();
// This is only present in Android nav endpoints
if (Reflect.has(data || {}, 'innertubeCommand'))
data = data.innertubeCommand;
const name = Object.keys(data || {})
.find((item) =>
item.endsWith('Endpoint') ||