wallet-core/node_modules/is-url/index.js
2017-05-28 00:40:43 +02:00

24 lines
299 B
JavaScript

/**
* Expose `isUrl`.
*/
module.exports = isUrl;
/**
* Matcher.
*/
var matcher = /^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/;
/**
* Loosely validate a URL `string`.
*
* @param {String} string
* @return {Boolean}
*/
function isUrl(string){
return matcher.test(string);
}