match-domain
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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 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 test

Maintain

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

Readme

Keywords

none

Package Sidebar

Install

npm i match-domain

Weekly Downloads

7

Version

1.0.0

License

MIT

Unpacked Size

16.8 kB

Total Files

12

Last publish

Collaborators

  • flexper