old_contents: var matches = require('matches-selector')
  
  module.exports = function (element, selector, checkYoSelf) {
    var parent = checkYoSelf ? element : element.parentNode
  
    while (parent && parent !== document) {
      if (matches(parent, selector)) return parent;
      parent = parent.parentNode
    }
  }
  
new_contents: var matches = require('matches-selector-ng');
  
  module.exports = function (element, selector) {
    var parent = element;
    do {
      if (matches(parent, selector)) return parent;
      parent = parent.parentNode;
    } while (parent && parent !== document);
  }
  
subject: update code to require element parameter, and drop 3rd parameter.