function checkElements(elements) {
    let contains = false;
    for (let i = 0; i < elements.length; i += 1) {
      const element = elements[i];
      if (
        element &&
        (isHTMLElement(element) || isShadowRoot(element)) &&
        deepContains(element, targetEl, cache)
      ) {
        contains = true;
        break;
      }
    }
    return contains;
  }
Check whether any element contains target
@param {(Element|ShadowRoot|null)[]} elements