var urlResolve = require('url').resolve;

// urlJoin joins two urls
// By resolving a url relative to the root url
// this works nicely with extra slashes in places
function urlJoin(rootUrl, url) {
    // Normalize then resolve URLs
    return urlResolve(
        // Ensure trailing slash
        rootUrl.replace(/\/+$/, '') + '/',
        // Trim preceding slash
        (url || '').replace(/^\/+/, '')
    );
}

module.exports = urlJoin;

@@ -38,16 +38,17 @@
 ve;%0A%0A// 
+_
 urlJoin 
@@ -62,16 +62,16 @@
 wo urls%0A
-
 // By re
@@ -168,16 +168,17 @@
 unction 
+_
 urlJoin(
@@ -292,23 +292,31 @@
         
+(
 rootUrl
+ %7C%7C '')
 .replace
@@ -407,16 +407,16 @@
 +/, '')%0A
-
     );%0A%7D
@@ -417,16 +417,252 @@
   );%0A%7D%0A%0A
+// urlJoin joins all arguments as URLs%0Afunction urlJoin() %7B%0A    var args = Array.prototype.slice.call(arguments, 0);%0A    return args.slice(1)%0A    .reduce(function(accu, x) %7B%0A        return _urlJoin(accu, x);%0A    %7D, args%5B0%5D %7C%7C '/');%0A%0A%7D%0A%0A
 module.e

Handle multiple args