code: function coerceElementMatchingCallback(value) {
    // Element Name
    if (typeof value === 'string') {
      return element => element.element === value;
    }
  
    // Element Type
    if (value.constructor && value.extend) {
      return element => element instanceof value;
    }
  
    return value;
  }
docs: Coerces an a parameter into a callback for matching elements. This accepts an element name, an element type and returns a callback to match for those elements.