release test fixes (#496)

* refactor: handle missing type

* fix: prevent stale data on cancel delay
This commit is contained in:
Carlos Valente
2023-08-24 22:53:23 +02:00
committed by GitHub
parent 1d4dc3a26f
commit af99882919
3 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -2,13 +2,13 @@ import { OntimeRundownEntry } from '../definitions/core/Rundown.type.js';
import { OntimeBlock, OntimeDelay, OntimeEvent, SupportedEvent } from '../definitions/core/OntimeEvent.type.js';
export function isOntimeEvent(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeEvent {
return event.type === SupportedEvent.Event;
return event?.type === SupportedEvent.Event;
}
export function isOntimeDelay(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeDelay {
return event.type === SupportedEvent.Delay;
return event?.type === SupportedEvent.Delay;
}
export function isOntimeBlock(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeBlock {
return event.type === SupportedEvent.Block;
return event?.type === SupportedEvent.Block;
}