lib/services/sites.js
function normalizePath(urlPath) {
  if (!urlPath) {
    return '';
  // make sure path starts with a /
  } else if (_.head(urlPath) !== '/') {
    urlPath = '/' + urlPath;
  }
  // make sure path does not end with a /
  return _.trimEnd(urlPath, '/');
}
function normalizePath(urlPath) {
  if (!urlPath) {
    return '';
  // make sure path starts with a /
  } else if (_.head(urlPath) !== '/') {
    urlPath = '/' + urlPath;
  }
  // make sure path does not end with a /
  return _.trimEnd(urlPath, '/');
}
function normalizePath ( urlPath ) { if ( ! urlPath ) { return '' ; // make sure path starts with a / } else if ( _ . head ( urlPath ) !== '/' ) { urlPath = '/' + urlPath ; } // make sure path does not end with a / return _ . trimEnd ( urlPath , '/' ) ; }
Normalize path to never end with a slash.

@param {string} urlPath
@returns {string}
Normalize path to never end with a slash .