diff options
Diffstat (limited to 'node_modules/url-parse-lax/index.js')
-rw-r--r-- | node_modules/url-parse-lax/index.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/node_modules/url-parse-lax/index.js b/node_modules/url-parse-lax/index.js new file mode 100644 index 000000000..f9c0c65af --- /dev/null +++ b/node_modules/url-parse-lax/index.js @@ -0,0 +1,14 @@ +'use strict'; +var url = require('url'); +var prependHttp = require('prepend-http'); + +module.exports = function (x) { + var withProtocol = prependHttp(x); + var parsed = url.parse(withProtocol); + + if (withProtocol !== x) { + parsed.protocol = null; + } + + return parsed; +}; |