Check if given domain/url matches against domain patterns.
- Only ~3 kB (~1.2 kB gzipped).
- Suitable for browser environments.
- No additional dependencies.
With NPM:
$ npm install domain-matcher
With Yarn:
$ yarn add domain-matcher
import { match } from 'domain-matcher'
match('domain.matcher.com', '*.matcher.com') // => true
match('matcher.com', '*.matcher.com') // => false
match('matcher.com', '*.matcher.com', '*.com') // => true (Only '*.com' matches)