hasprotocol

1.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i hasprotocol

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

4.45 kB

Total Files

5

Last publish

Collaborators

  • danielcobo