• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2var url = require('url');
3var prependHttp = require('prepend-http');
4
5module.exports = function (x) {
6	var withProtocol = prependHttp(x);
7	var parsed = url.parse(withProtocol);
8
9	if (withProtocol !== x) {
10		parsed.protocol = null;
11	}
12
13	return parsed;
14};
15