hasListener(event, listener, options = {}) {

    if (WebMidi.validation) {

      // Legacy compatibility
      if (typeof options === "function") {
        let channels = [].concat(listener); // clone
        listener = options;
        options = {channels: channels};
      }

    }

    if (Enumerations.CHANNEL_EVENTS.includes(event)) {

      // If no channel defined, use all.
      if (options.channels === undefined) options.channels = Enumerations.MIDI_CHANNEL_NUMBERS;

      return Utilities.sanitizeChannels(options.channels).every(ch => {
        return this.channels[ch].hasListener(event, listener);
      });

    } else {
      return super.hasListener(event, listener);
    }

  }
Checks if the specified event type is already defined to trigger the specified callback
function. For channel-specific events, the function will return `true` only if all channels
have the listener defined.

@param event {string|Symbol} The type of the event.

@param listener {function} The callback function to check for.

@param {object} [options={}]

@param {number|number[]} [options.channels]  An integer between 1 and 16 or an array of such
integers representing the MIDI channel(s) to check. This parameter is ignored for input-wide
events.

@returns {boolean} Boolean value indicating whether or not the `Input` or
[`InputChannel`](InputChannel) already has this listener defined.