code: function removeListeners(target, type) {
    const listeners = getListeners(target, type);
    if (listeners) {
      for (let i = 0, ii = listeners.length; i < ii; ++i) {
        /** @type {import("./events/Target.js").default} */ (target).
          removeEventListener(type, listeners[i].boundListener);
        clear(listeners[i]);
      }
      listeners.length = 0;
      const listenerMap = getListenerMap(target);
      if (listenerMap) {
        delete listenerMap[type];
        if (Object.keys(listenerMap).length === 0) {
          removeListenerMap(target);
        }
      }
    }
  }
docs: Clean up all listener objects of the given type.  All properties on the
  listener objects will be removed, and if no listeners remain in the listener
  map, it will be removed from the target.
  @param {import("./events/Target.js").EventTargetLike} target Target.
  @param {string} type Type.