github.com/outbrain/consul@v1.4.5/ui-v2/app/utils/dom/closest.js (about)

     1  export default function(sel, el) {
     2    // basic DOM closest utility to cope with no support
     3    // TODO: instead of degrading gracefully
     4    // add a while polyfill for closest
     5    try {
     6      return el.closest(sel);
     7    } catch (e) {
     8      return;
     9    }
    10  }