function collapseLeadingSlashes(str) {
  let i = 0;
  for (; i < str.length; i++) {
    if (str.charCodeAt(i) !== 47) {
      break;
    }
  }
  return i > 1 ? "/" + str.substr(i) : str;
}
/**
 * Collapse all leading slashes into a single slash
 * @private
 */
Collapse all leading slashes into a single slash
@private
Collapse all leading slashes into a single slash @private
function collapseLeadingSlashes(str) {
  let i = 0;
  for (; i < str.length; i++) {
    if (str.charCodeAt(i) !== 47) {
      break;
    }
  }
  return i > 1 ? "/" + str.substr(i) : str;
}
function collapseLeadingSlashes ( str ) { let i = 0 ; for ( ; i < str . length ; i ++ ) { if ( str . charCodeAt ( i ) !== 47 ) { break ; } } return i > 1 ? "/" + str . substr ( i ) : str ; }
Collapse all leading slashes into a single slash
 @private
Collapse all leading slashes into a single slash @private