is-relative-url
v4.0.0
Published
Check if a URL is relative
Downloads
2,048,724
Maintainers
Readme
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.