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

Function matches

modular/sortable.complete.esm.js:137–154  ·  view source on GitHub ↗
( /**HTMLElement*/el, /**String*/selector)

Source from the content-addressed store, hash-verified

135 el.removeEventListener(event, fn, !IE11OrLess && captureMode);
136}
137function matches( /**HTMLElement*/el, /**String*/selector) {
138 if (!selector) return;
139 selector[0] === '>' && (selector = selector.substring(1));
140 if (el) {
141 try {
142 if (el.matches) {
143 return el.matches(selector);
144 } else if (el.msMatchesSelector) {
145 return el.msMatchesSelector(selector);
146 } else if (el.webkitMatchesSelector) {
147 return el.webkitMatchesSelector(selector);
148 }
149 } catch (_) {
150 return false;
151 }
152 }
153 return false;
154}
155function getParentOrHost(el) {
156 return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
157}

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…