summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/url-parse-lax/index.js
blob: f9c0c65afdbbd590e746c51ef61135fed7aabf9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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;
};