1.0.0 • Published 2 years ago

match-domain v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

NPM

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 NameTypeDefaultDescription
domainAstringmandatoryMandatory domain A to match
domainBstringmandatoryMandatory domain B to match with A

Tests

To execute jest tests:

pnpm test

Maintain

This package use TSdx. Please check documentation to update this package.