Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getMatchingEventTarget = (ev, selector) => {
let target = ev.target;
while (!(!(target instanceof Element) || Rails.matches(target, selector))) {
target = target.parentNode;
}
if (target instanceof Element) {
return target;
}
return null;
};
const handleDocumentEvent = (ev, matchSelectors) => {