A simple library to match url domains.
import { urlMatcher } from 'url-matcher';
function matchExample() {
const toMatch = 'www.fetcher.ai';
const domain = 'fetcher.ai';
if (urlMatcher(domain, toMatch)) {
// do things...
}
}
Return: Boolean depending on the result is true or false.
Params
Field Name | Type | Default | Description |
---|---|---|---|
domainA | string | mandatory | Mandatory domain A to match |
domainB | string | mandatory | Mandatory domain B to match with A |
To execute jest tests:
pnpm test
This package use TSdx. Please check documentation to update this package.