mrded / is-url-external

Check whether an url is external or not.

Home Page:https://www.npmjs.com/package/is-url-external

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Check whether an url is external or not.

https://www.npmjs.com/package/is-url-external

License:Do What The F*ck You Want To Public License


Languages

Language:TypeScript 61.4%Language:JavaScript 38.6%