feat(companion): validate event wait helper input names

This commit is contained in:
William Valentin
2026-02-16 19:43:32 -08:00
parent 4f6904c395
commit 490ca7def9
4 changed files with 32 additions and 1 deletions
+6
View File
@@ -437,6 +437,9 @@ export class CompanionRuntimeClient {
signal?: AbortSignal;
},
): Promise<TData> {
if (eventName.trim().length === 0) {
throw new Error('eventName must be a non-empty string');
}
const timeoutMs = options?.timeoutMs ?? this.requestTimeoutMs;
const predicate = options?.predicate;
const signal = options?.signal;
@@ -502,6 +505,9 @@ export class CompanionRuntimeClient {
if (eventNames.length === 0) {
throw new Error('eventNames must contain at least one event name');
}
if (eventNames.some((eventName) => eventName.trim().length === 0)) {
throw new Error('eventNames must not contain empty values');
}
const eventNameSet = new Set(eventNames);
const timeoutMs = options?.timeoutMs ?? this.requestTimeoutMs;
const predicate = options?.predicate;