"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchUnitErrEvent = watchUnitErrEvent;
function watchUnitErrEvent(event, unit, callback) {
    const listener = (err) => {
        callback({
            type: 'unit',
            event,
            data: { err },
        });
    };
    unit.prependListener(event, listener);
    return () => {
        unit.removeListener(event, listener);
    };
}
//# sourceMappingURL=watchUnitErrEvent.js.map