Skip to content

Commit

Permalink
simplify checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Jan 6, 2025
1 parent a045145 commit c2293eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function parse (uri, opts) {
isIP = true
}
}
if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && !parsed.path && parsed.query === undefined) {
if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {
parsed.reference = 'same-document'
} else if (parsed.scheme === undefined) {
parsed.reference = 'relative'
Expand Down Expand Up @@ -270,10 +270,10 @@ function parse (uri, opts) {
if (gotEncoding && parsed.host !== undefined) {
parsed.host = unescape(parsed.host)
}
if (parsed.path && parsed.path.length) {
if (parsed.path) {
parsed.path = escape(unescape(parsed.path))
}
if (parsed.fragment && parsed.fragment.length) {
if (parsed.fragment) {
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))
}
}
Expand Down

0 comments on commit c2293eb

Please sign in to comment.