lib/index.js
function joinURL (urlA, urlB) {
  urlA = urlA || "";
  urlB = urlB || "";

  let endsWithASlash = urlA.substr(-1) === "/" || urlA.substr(-1) === "\\";
  let startsWithASlash = urlB[0] === "/" || urlB[0] === "\\";

  if (endsWithASlash || startsWithASlash) {
    return urlA + urlB;
  }
  else {
    return urlA + "/" + urlB;
  }
}
function joinURL (urlA, urlB) {
  urlA = urlA || "";
  urlB = urlB || "";

  let endsWithASlash = urlA.substr(-1) === "/" || urlA.substr(-1) === "\\";
  let startsWithASlash = urlB[0] === "/" || urlB[0] === "\\";

  if (endsWithASlash || startsWithASlash) {
    return urlA + urlB;
  }
  else {
    return urlA + "/" + urlB;
  }
}
function joinURL ( urlA , urlB ) { urlA = urlA || "" ; urlB = urlB || "" ; let endsWithASlash = urlA . substr ( - 1 ) === "/" || urlA . substr ( - 1 ) === "\\" ; let startsWithASlash = urlB [ 0 ] === "/" || urlB [ 0 ] === "\\" ; if ( endsWithASlash || startsWithASlash ) { return urlA + urlB ; } else { return urlA + "/" + urlB ; } }
Joins two URL paths, possibly adding a separator.

@param {string} urlA
@param {string} urlB
@returns {string}
Joins two URL paths possibly adding a separator .