| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -169,8 +169,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { | |||
| 169 | 169 | ||
| 170 | 170 | // find the first instance of any hostEndingChars | |
| 171 | 171 | var hostEnd = -1; | |
| 172 | - for (var i = 0; i < hostEndingChars.length; i++) { | ||
| 173 | - var hec = rest.indexOf(hostEndingChars[i]); | ||
| 172 | + for (let i = 0; i < hostEndingChars.length; i++) { | ||
| 173 | + const hec = rest.indexOf(hostEndingChars[i]); | ||
| 174 | 174 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) | |
| 175 | 175 | hostEnd = hec; | |
| 176 | 176 | } | |
@@ -197,8 +197,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { | |||
| 197 | 197 | ||
| 198 | 198 | // the host is the remaining to the left of the first non-host char | |
| 199 | 199 | hostEnd = -1; | |
| 200 | - for (var i = 0; i < nonHostChars.length; i++) { | ||
| 201 | - var hec = rest.indexOf(nonHostChars[i]); | ||
| 200 | + for (let i = 0; i < nonHostChars.length; i++) { | ||
| 201 | + const hec = rest.indexOf(nonHostChars[i]); | ||
| 202 | 202 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) | |
| 203 | 203 | hostEnd = hec; | |
| 204 | 204 | } | |
@@ -224,12 +224,12 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { | |||
| 224 | 224 | // validate a little. | |
| 225 | 225 | if (!ipv6Hostname) { | |
| 226 | 226 | var hostparts = this.hostname.split(/\./); | |
| 227 | - for (var i = 0, l = hostparts.length; i < l; i++) { | ||
| 227 | + for (let i = 0, l = hostparts.length; i < l; i++) { | ||
| 228 | 228 | var part = hostparts[i]; | |
| 229 | 229 | if (!part) continue; | |
| 230 | 230 | if (!part.match(hostnamePartPattern)) { | |
| 231 | 231 | var newpart = ''; | |
| 232 | - for (var j = 0, k = part.length; j < k; j++) { | ||
| 232 | + for (let j = 0, k = part.length; j < k; j++) { | ||
| 233 | 233 | if (part.charCodeAt(j) > 127) { | |
| 234 | 234 | // we replace non-ASCII char with a temporary placeholder | |
| 235 | 235 | // we need this to make sure size of hostname is not | |
@@ -294,7 +294,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { | |||
| 294 | 294 | // First, make 100% sure that any "autoEscape" chars get | |
| 295 | 295 | // escaped, even if encodeURIComponent doesn't think they | |
| 296 | 296 | // need to be. | |
| 297 | - for (var i = 0, l = autoEscape.length; i < l; i++) { | ||
| 297 | + for (let i = 0, l = autoEscape.length; i < l; i++) { | ||
| 298 | 298 | var ae = autoEscape[i]; | |
| 299 | 299 | if (rest.indexOf(ae) === -1) | |
| 300 | 300 | continue; | |
@@ -335,8 +335,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { | |||
| 335 | 335 | ||
| 336 | 336 | //to support http.request | |
| 337 | 337 | if (this.pathname || this.search) { | |
| 338 | - var p = this.pathname || ''; | ||
| 339 | - var s = this.search || ''; | ||
| 338 | + const p = this.pathname || ''; | ||
| 339 | + const s = this.search || ''; | ||
| 340 | 340 | this.path = p + s; | |
| 341 | 341 | } | |
| 342 | 342 | ||
@@ -498,7 +498,7 @@ Url.prototype.resolveObject = function(relative) { | |||
| 498 | 498 | if (!relative.host && | |
| 499 | 499 | !/^file:?$/.test(relative.protocol) && | |
| 500 | 500 | !hostlessProtocol[relative.protocol]) { | |
| 501 | - var relPath = (relative.pathname || '').split('/'); | ||
| 501 | + const relPath = (relative.pathname || '').split('/'); | ||
| 502 | 502 | while (relPath.length && !(relative.host = relPath.shift())); | |
| 503 | 503 | if (!relative.host) relative.host = ''; | |
| 504 | 504 | if (!relative.hostname) relative.hostname = ''; | |
@@ -533,8 +533,8 @@ Url.prototype.resolveObject = function(relative) { | |||
| 533 | 533 | var mustEndAbs = (isRelAbs || isSourceAbs || | |
| 534 | 534 | (result.host && relative.pathname)); | |
| 535 | 535 | const removeAllDots = mustEndAbs; | |
| 536 | - var srcPath = result.pathname && result.pathname.split('/') || []; | ||
| 537 | - var relPath = relative.pathname && relative.pathname.split('/') || []; | ||
| 536 | + let srcPath = result.pathname && result.pathname.split('/') || []; | ||
| 537 | + const relPath = relative.pathname && relative.pathname.split('/') || []; | ||
| 538 | 538 | const psychotic = result.protocol && !slashedProtocol[result.protocol]; | |
| 539 | 539 | ||
| 540 | 540 | // if the url is a non-slashed url, then relative | |
@@ -589,7 +589,7 @@ Url.prototype.resolveObject = function(relative) { | |||
| 589 | 589 | //occasionally the auth can get stuck only in host | |
| 590 | 590 | //this especially happens in cases like | |
| 591 | 591 | //url.resolveObject('mailto:local1@domain1', 'local2@domain2') | |
| 592 | - var authInHost = result.host && result.host.indexOf('@') > 0 ? | ||
| 592 | + const authInHost = result.host && result.host.indexOf('@') > 0 ? | ||
| 593 | 593 | result.host.split('@') : false; | |
| 594 | 594 | if (authInHost) { | |
| 595 | 595 | result.auth = authInHost.shift(); | |
@@ -632,7 +632,7 @@ Url.prototype.resolveObject = function(relative) { | |||
| 632 | 632 | // strip single dots, resolve double dots to parent dir | |
| 633 | 633 | // if the path tries to go above the root, `up` ends up > 0 | |
| 634 | 634 | var up = 0; | |
| 635 | - for (var i = srcPath.length; i >= 0; i--) { | ||
| 635 | + for (let i = srcPath.length; i >= 0; i--) { | ||
| 636 | 636 | last = srcPath[i]; | |
| 637 | 637 | if (last === '.') { | |
| 638 | 638 | spliceOne(srcPath, i); | |
@@ -671,7 +671,7 @@ Url.prototype.resolveObject = function(relative) { | |||
| 671 | 671 | //occasionally the auth can get stuck only in host | |
| 672 | 672 | //this especially happens in cases like | |
| 673 | 673 | //url.resolveObject('mailto:local1@domain1', 'local2@domain2') | |
| 674 | - var authInHost = result.host && result.host.indexOf('@') > 0 ? | ||
| 674 | + const authInHost = result.host && result.host.indexOf('@') > 0 ? | ||
| 675 | 675 | result.host.split('@') : false; | |
| 676 | 676 | if (authInHost) { | |
| 677 | 677 | result.auth = authInHost.shift(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments