Skip to content

Commit

Permalink
Changing indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
zacaronichizzy committed Feb 28, 2018
1 parent 456784e commit 2a5812c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions resolveUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ module.exports = function (base, href) { // RFC 3986
function removeDotSegments (input) {
var output = []
input.replace(/^(\.\.?(\/|$))+/, '')
.replace(/\/(\.(\/|$))+/g, '/')
.replace(/\/\.\.$/, '/../')
.replace(/\/?[^/]*/g, function (p) {
if (p === '/..') {
output.pop()
} else {
output.push(p)
}
})
.replace(/\/(\.(\/|$))+/g, '/')
.replace(/\/\.\.$/, '/../')
.replace(/\/?[^/]*/g, function (p) {
if (p === '/..') {
output.pop()
} else {
output.push(p)
}
})
return output.join('').replace(/^\//, input.charAt(0) === '/' ? '/' : '')
}

Expand Down

0 comments on commit 2a5812c

Please sign in to comment.