@oscarpalmer/toretto 0.37.1 → 0.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,9 @@
1
1
  function findAncestor(origin, selector) {
2
2
  const element = getElement(origin);
3
3
  if (element == null || selector == null) return null;
4
- console.log(element);
5
4
  if (typeof selector === "string") {
6
- if (element.matches?.(selector)) return element;
7
- return element.closest(selector);
5
+ if (Element.prototype.matches.call(element, selector)) return element;
6
+ return Element.prototype.closest.call(element, selector);
8
7
  }
9
8
  if (typeof selector !== "function") return null;
10
9
  if (selector(element)) return element;
@@ -658,10 +658,9 @@ const PROPERTY_DETAIL = "detail";
658
658
  function findAncestor(origin, selector) {
659
659
  const element = getElement(origin);
660
660
  if (element == null || selector == null) return null;
661
- console.log(element);
662
661
  if (typeof selector === "string") {
663
- if (element.matches?.(selector)) return element;
664
- return element.closest(selector);
662
+ if (Element.prototype.matches.call(element, selector)) return element;
663
+ return Element.prototype.closest.call(element, selector);
665
664
  }
666
665
  if (typeof selector !== "function") return null;
667
666
  if (selector(element)) return element;
package/package.json CHANGED
@@ -93,5 +93,5 @@
93
93
  },
94
94
  "type": "module",
95
95
  "types": "types/index.d.ts",
96
- "version": "0.37.1"
96
+ "version": "0.37.2"
97
97
  }