@n3okill/utils
Version:
Many javascript helpers
10 lines • 352 B
JavaScript
/**
* Returns a value indicating whether a URL is relative.
* A relative URL does not have host info part.
* @param {string} url - the URL to be checked
* @return {boolean} whether the URL is relative
*/
export function isUrlRelative(url) {
return !url.startsWith("//") && url.indexOf("://") === -1;
}
//# sourceMappingURL=isUrlRelative.js.map