<commit_before>import prefixed from './prefixed';

let _matchMethod;

export default function matchesSelector(elm, selector) {
  if(_matchMethod) { return _matchMethod.call(elm, selector); }

  _matchMethod = elm.matches || prefixed('MatchesSelector').filter((method) => !!elm[method])[0];
  if(!_matchMethod) { _matchMethod = () => false; }

  return matchesSelector(elm, selector);
}<commit_msg>Simplified matchesSelector script<commit_after>import prefixed from './prefixed';

const div = document.createElement('div');
const _matchMethod = div.matches || prefixed('MatchesSelector').filter((method) => !!div[method])[0];

export default function matchesSelector(elm, selector) {
  return _matchMethod.call(elm, selector);
}
{'fraction_non_alphanumeric': 0.14718019257221457, 'fraction_numerical': 0.002751031636863824, 'mean_word_length': 7.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3664805', 'n_tokens_mistral': 210, 'n_tokens_neox': 206, 'n_words': 47}