initial commit
This commit is contained in:
21
node_modules/url-parse-as-address/index.js
generated
vendored
Normal file
21
node_modules/url-parse-as-address/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
var url = require('url')
|
||||
var assert = require('assert')
|
||||
|
||||
module.exports = parse
|
||||
parse.format = format
|
||||
parse.parse = parse
|
||||
|
||||
function parse (str, parseQueryString) {
|
||||
assert.equal(typeof str, 'string')
|
||||
var p = url.parse(str, parseQueryString)
|
||||
if (!p.slashes)
|
||||
p = url.parse('http://' + str, parseQueryString)
|
||||
else if (!p.protocol)
|
||||
p = url.parse('http:' + str, parseQueryString)
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
function format (str) {
|
||||
return url.format(parse(str))
|
||||
}
|
||||
Reference in New Issue
Block a user