code: function matchesFilter (pattern, channel) {
      // If multi-level wildcard is the only character in pattern, then any string will match
      if (pattern==="#") {
          return true;
      }
      // Handle all other multi-level wildcards
      // FROM SPEC: The number sign (‘#’ U+0023) is a wildcard character that matches any number of levels within a topic. The multi-level wildcard represents the parent and any number of child levels. The multi-level wildcard character MUST be specified either on its own or following a topic level separator. In either case it MUST be the last character specified in the Topic Filter
      var p_wo_wildcard = pattern.substring(0, pattern.length-2);
      var str_wo_details = channel.substring(0, pattern.length-2);
      if (pattern.slice(-1)=='#' && p_wo_wildcard==str_wo_details) {
          return true;
      }
      // TODO Handle single-level wildcards (+)
      // FROM SPEC: The single-level wildcard can be used at any level in the Topic Filter, including first and last levels. Where it is used it MUST occupy an entire level of the filter [MQTT-4.7.1-3]. It can be used at more than one level in the Topic Filter and can be used in conjunction with the multilevel wildcard.
      // http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718107
      return false;
  }
docs: Helper function that checks a certain channel and see if it matches a wildcard pattern Returns true if the channel matches a pattern (including the exact pattern)