feat(parser): Support LockupView and it's child nodes (#609)

This commit is contained in:
absidue
2024-02-29 17:29:53 +01:00
committed by GitHub
parent f95283b236
commit 7ca2a0c3e4
10 changed files with 179 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ import type { RawNode } from '../index.js';
import { Text } from '../misc.js';
export type MetadataRow = {
metadata_parts: {
metadata_parts?: {
text: Text;
}[];
};
@@ -17,7 +17,7 @@ export default class ContentMetadataView extends YTNode {
constructor(data: RawNode) {
super();
this.metadata_rows = data.metadataRows.map((row: RawNode) => ({
metadata_parts: row.metadataParts.map((part: RawNode) => ({
metadata_parts: row.metadataParts?.map((part: RawNode) => ({
text: Text.fromAttributed(part.text)
}))
}));