addon/utils/url-utils.js
function assembleUrl (parts, insertPort = false) {
  let result;
  if (insertPort) {
    result = `${parts.protocol}://${parts.host}:${parts.port}`;
  } else {
    result = `${parts.protocol}://${parts.host}`;
  }

  if (parts.path) {
    result = `${result}/${parts.path}`;
  }
  return result;
}
function assembleUrl (parts, insertPort = false) {
  let result;
  if (insertPort) {
    result = `${parts.protocol}://${parts.host}:${parts.port}`;
  } else {
    result = `${parts.protocol}://${parts.host}`;
  }

  if (parts.path) {
    result = `${result}/${parts.path}`;
  }
  return result;
}
function assembleUrl ( parts , insertPort = false ) { let result ; if ( insertPort ) { result = ` ${ parts . protocol } ${ parts . host } ${ parts . port } ` ; } else { result = ` ${ parts . protocol } ${ parts . host } ` ; } if ( parts . path ) { result = ` ${ result } ${ parts . path } ` ; } return result ; }
Assemble a full url from a hash of parts, optionally forcing a port
Assemble a full url from a hash of parts optionally forcing a port