"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStreamEndOrErrorEvent = isStreamEndOrErrorEvent;
const eventTypeUtils_1 = require("./eventTypeUtils.js");
const STREAM_END_TYPES = ['response.done', 'response.completed', 'response.failed'];
function isStreamEndOrErrorEvent(event) {
    if (!event) {
        return false;
    }
    const e = event;
    if (e.type === 'error')
        return true;
    return (0, eventTypeUtils_1.isEventOneOf)(e, e.data, STREAM_END_TYPES);
}
//# sourceMappingURL=isStreamEndOrErrorEvent.js.map
