8000 GitHub - sindresorhus/is-relative-url: Check if a URL is relative
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sindresorhus/is-relative-url

Repository files navigation

is-relative-url

Check if a URL is relative

Install

npm install is-relative-url

Usage

import isRelativeUrl from 'is-relative-url';

isRelativeUrl('foo/bar');
//=> true

isRelativeUrl('https://sindresorhus.com/foo/bar');
//=> false

isRelativeUrl('//sindresorhus.com');
//=> true

Related

See is-absolute-url for the inverse.

About

Check if a URL is relative

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0