import { isEventOneOf } from "./eventTypeUtils.js";
const STREAM_END_TYPES = ['response.done', 'response.completed', 'response.failed'];
export function isStreamEndOrErrorEvent(event) {
    if (!event) {
        return false;
    }
    const e = event;
    if (e.type === 'error')
        return true;
    return isEventOneOf(e, e.data, STREAM_END_TYPES);
}
//# sourceMappingURL=isStreamEndOrErrorEvent.js.map
