diff options
Diffstat (limited to 'node_modules/is-url/index.js')
-rw-r--r-- | node_modules/is-url/index.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/node_modules/is-url/index.js b/node_modules/is-url/index.js new file mode 100644 index 000000000..1ef5187e4 --- /dev/null +++ b/node_modules/is-url/index.js @@ -0,0 +1,23 @@ + +/** + * 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); +} |