var h = /* @__PURE__ */ function() {
  function a() {
    this.listeners = {};
  }
  var e = a.prototype;
  return e.on = function(s, t) {
    this.listeners[s] || (this.listeners[s] = []), this.listeners[s].push(t);
  }, e.off = function(s, t) {
    if (!this.listeners[s])
      return !1;
    var i = this.listeners[s].indexOf(t);
    return this.listeners[s] = this.listeners[s].slice(0), this.listeners[s].splice(i, 1), i > -1;
  }, e.trigger = function(s) {
    var t = this.listeners[s];
    if (t)
      if (arguments.length === 2)
        for (var i = t.length, n = 0; n < i; ++n)
          t[n].call(this, arguments[1]);
      else
        for (var o = Array.prototype.slice.call(arguments, 1), f = t.length, l = 0; l < f; ++l)
          t[l].apply(this, o);
  }, e.dispose = function() {
    this.listeners = {};
  }, e.pipe = function(s) {
    this.on("data", function(t) {
      s.push(t);
    });
  }, a;
}();
export {
  h as default
};
//# sourceMappingURL=stream.js.map
