1.0.3 • Published 5 years ago

hasprotocol v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

hasprotocol

Returns true/false if string starts with a protocol such as http

hasProtocol('http://') //true
hasProtocol('http://hello') //true
hasProtocol('helloworldhttp://hello') //false


hasProtocol('https://') //true
hasProtocol('https://hello') //true
hasProtocol('helloworldhttps://hello') //false


hasProtocol('localhost://') //true
hasProtocol('localhost://hello') //true
hasProtocol('helloworldlocalhost://hello') //false


hasProtocol('file:///') //true
hasProtocol('file:///') //true
hasProtocol('helloworldfile:///') //false