/**
 * Checks if a node matches or contains the node given by the provided query css selector
 *
 * @param query - CSS selector string
 * @returns true if node matches or contains query or false otherwise
 */
export var getNodeQuery = function getNodeQuery(query) {
  return function (node) {
    if (!node || !(node instanceof Element)) {
      return false;
    }
    return node.matches(query) || node.querySelector(query) !== null;
  };
};