Check if a URL is relative
npm install is-relative-url
import isRelativeUrl from 'is-relative-url';
isRelativeUrl('foo/bar');
//=> true
isRelativeUrl('https://sindresorhus.com/foo/bar');
//=> false
isRelativeUrl('//sindresorhus.com');
//=> true
See is-absolute-url for the inverse.