Check if a DOM element matches a given selector, with decent browser support and unit tests.
npm install matches-selector-ng   
Check if an element matches a given selector. Uses the nativematches method
if present. For use with a commonjs bundler such as Browserify or Webpack.
$ yarn add matches-selector-ng
``js``
var matches = require('matches-selector-ng');
matches(el, 'ul li a');
// => true or false
Both TypeScript and
Flow type definitions for this module are included!
The type definitions won't require any configuration to use.