feat(parser): Add AlertWithButton (#486)

This commit is contained in:
absidue
2023-08-27 21:29:23 +02:00
committed by GitHub
parent ed7be2a675
commit 8b69587787
4 changed files with 25 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import PlayerCaptionsTracklist from './classes/PlayerCaptionsTracklist.js';
import PlayerLiveStoryboardSpec from './classes/PlayerLiveStoryboardSpec.js';
import PlayerStoryboardSpec from './classes/PlayerStoryboardSpec.js';
import Alert from './classes/Alert.js';
import AlertWithButton from './classes/AlertWithButton.js';
import type { IParsedResponse, IRawResponse, RawData, RawNode } from './types/index.js';
@@ -310,7 +311,7 @@ export function parseResponse<T extends IParsedResponse = IParsedResponse>(data:
parsed_data.overlay = overlay;
}
const alerts = parseArray(data.alerts, Alert);
const alerts = parseArray(data.alerts, [ Alert, AlertWithButton ]);
if (alerts.length) {
parsed_data.alerts = alerts;
}