domain-matcher
v1.0.0
Published
[![Build Status](https://api.travis-ci.org/AurityLab/domain-matcher.svg?branch=master)](https://travis-ci.org/AurityLab/domain-matcher) [![npm](https://img.shields.io/npm/v/recaptcha-v3.svg)](https://www.npmjs.com/package/domain-matcher) [![npm type defin
Downloads
9
Readme
Domain matcher
Check if given domain/url matches against domain patterns.
Features
- Only ~3 kB (~1.2 kB gzipped).
- Suitable for browser environments.
- No additional dependencies.
Install
With NPM:
$ npm install domain-matcher
With Yarn:
$ yarn add domain-matcher
Usage
import { match } from 'domain-matcher'
match('domain.matcher.com', '*.matcher.com') // => true
match('matcher.com', '*.matcher.com') // => false
match('matcher.com', '*.matcher.com', '*.com') // => false (Because '*.com' matches)