Skip to content

tommedema/url-is-protoless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-is-protoless

An incredibly simple utility to check if a given url does not have a protocol, while still representing a path. This is typically used to determine if found urls are relative rather than absolute.

JavaScript Style Guide

Table of Contents

isProtoless

Returns if a url does not have a protocol, while still representing a path.

Parameters

Examples

const isProtoless = require('url-is-protoless')
console.log(isProtoless('./assets/icon.png')) // true
console.log(isProtoless('http://example.com/assets/icon.png')) // false
console.log(isProtoless('//example.com/assets/icon.png')) // true

Returns boolean whether the url is without a protocol

About

An incredibly simple utility to check if a given url does not have a protocol, while still representing a path.

Resources

License

Stars

Watchers

Forks

Packages

No packages published