You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 268B

1234567891011121314
  1. 'use strict';
  2. var url = require('url');
  3. var prependHttp = require('prepend-http');
  4. module.exports = function (x) {
  5. var withProtocol = prependHttp(x);
  6. var parsed = url.parse(withProtocol);
  7. if (withProtocol !== x) {
  8. parsed.protocol = null;
  9. }
  10. return parsed;
  11. };