code: function getFilter(filterList, dimensionId, isWhiteList) {
      var thisIdsFilterList = filterList[dimensionId];
      if (!defined(thisIdsFilterList)) {
        return function() {
          return true;
        };
      }
      try {
        var thisIdsRegExps = thisIdsFilterList.map(
          string => new RegExp("^" + string + "$")
        );
        return function(value) {
          // Test as a straight string, and if that fails, as a regular expression.
          var isPresent =
            thisIdsFilterList.indexOf(value.id) >= 0 ||
            thisIdsRegExps.map(regExp => value.id.match(regExp)).some(defined);
          if (isWhiteList) {
            return isPresent;
          }
          return !isPresent;
        };
      } catch (e) {
        // Cannot intepret as a regular expression.
        // Eg. "[" causes Uncaught SyntaxError: Invalid regular expression: /[/: Unterminated character class(…)),
        // So just test as a string.
        return function(value) {
          var isPresent = thisIdsFilterList.indexOf(value.id) >= 0;
          if (isWhiteList) {
            return isPresent;
          }
          return !isPresent;
        };
      }
    }
docs: getFilter returns a function which can be used in list.filter(). It tests if the value is in the given list, using regexps if possible. filterList can be either item.whitelist or item.blacklist. set isWhiteList false if is blacklist, so that the return values are negated (except for a missing list).