File: index.js

package info (click to toggle)
node-url-parse-lax 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 104 kB
  • ctags: 5
  • sloc: makefile: 2; sh: 2
file content (14 lines) | stat: -rw-r--r-- 268 bytes parent folder | download | duplicates (2)
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;
};