MCPcopy Index your code
hub / github.com/SortableJS/Sortable / matches

Function matches

src/utils.js:18–38  ·  view source on GitHub ↗
(/**HTMLElement*/el, /**String*/selector)

Source from the content-addressed store, hash-verified

16}
17
18function matches(/**HTMLElement*/el, /**String*/selector) {
19 if (!selector) return;
20
21 selector[0] === '>' && (selector = selector.substring(1));
22
23 if (el) {
24 try {
25 if (el.matches) {
26 return el.matches(selector);
27 } else if (el.msMatchesSelector) {
28 return el.msMatchesSelector(selector);
29 } else if (el.webkitMatchesSelector) {
30 return el.webkitMatchesSelector(selector);
31 }
32 } catch(_) {
33 return false;
34 }
35 }
36
37 return false;
38}
39
40function getParentOrHost(el) {
41 return (el.host && el !== document && el.host.nodeType && el.host !== el)

Callers 3

closestFunction · 0.70
lastChildFunction · 0.70
indexFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…