1.0.0 • Published 3 years ago
match-domain v1.0.0
Url Matcher
A simple library to match url domains.
Usage
import { urlMatcher } from 'url-matcher';
function matchExample() {
const toMatch = 'www.fetcher.ai';
const domain = 'fetcher.ai';
if (urlMatcher(domain, toMatch)) {
// do things...
}
}API
urlMatcher(domainA: string, domainB: string): boolean
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 |
Tests
To execute jest tests:
pnpm testMaintain
This package use TSdx. Please check documentation to update this package.
1.0.0
3 years ago