_doesPassFilter(category, element) {
    if (typeof category === 'function') {
      return category.call(element, element, this);
    }

    // Check each element's data-groups attribute against the given category.
    const attr = element.dataset[Shuffle.FILTER_ATTRIBUTE_KEY];
    const keys = this.options.delimiter ? attr.split(this.options.delimiter) : JSON.parse(attr);

    function testCategory(category) {
      return keys.includes(category);
    }

    if (Array.isArray(category)) {
      if (this.options.filterMode === Shuffle.FilterMode.ANY) {
        return category.some(testCategory);
      }
      return category.every(testCategory);
    }

    return keys.includes(category);
  }
Test an item to see if it passes a category.
@param {string|string[]|function():boolean} category Category or function to filter by.
@param {Element} element An element to test.
@return {boolean} Whether it passes the category/filter.
@private