Skip to content

Commit 02995c6

Browse files
committed
Merge branch 'patch-1' of github.com:viceice/parse-path into new-version
2 parents cbb46e0 + 01b23dc commit 02995c6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function parsePath(url) {
4242
output.protocols = protocols(parsed)
4343
output.protocol = output.protocols[0]
4444
output.port = parsed.port
45-
output.resource = parsed.host
45+
output.resource = parsed.hostname
4646
output.user = parsed.username || ""
4747
output.password = parsed.password || ""
4848
output.pathname = parsed.pathname

test/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,20 @@ const INPUTS = [
241241
, query: {}
242242
, search: ""
243243
}
244+
], [
245+
"https://github.com:89/org/repo.git"
246+
, {
247+
protocols: ["https"]
248+
, protocol: "https"
249+
, port: "89"
250+
, resource: "github.com"
251+
, user: ""
252+
, pathname: "/org/repo.git"
253+
, hash: ""
254+
, href: "https://github.com:89/org/repo.git"
255+
, query: {}
256+
, search: ""
257+
}
244258
]
245259
];
246260

0 commit comments

Comments
 (0)