2.0.1 • Published 2 years ago

is-url-external v2.0.1

Weekly downloads
1,891
License
WTFPL
Repository
github
Last release
2 years ago

Is URL External?

A simple function that tells you whether an URL is external or not.

Usage

import { isUrlExternal } from "./index";

isUrlExternal('https://github.com/mrded/is-url-external', 'github.com'); // false 

const isExternal = (url: string) => isUrlExternal(url, window.location.hostname);
isExternal('https://github.com/mrded/is-url-external'); // true | false