UNPKG

data-provider-temporary

Version:

Library that helps with server-to-client synchronization of data

15 lines (11 loc) 268 B
'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; };