lib/index.js
function normalizePath (path) {
		// Remove double slashes
		if (path.indexOf('//') !== -1) {
			path = path.replace(/\/+/g, '/');
		}

		// Shift slash
		if (path[0] === '/') {
			path = path.substr(1);
		}
		
		// Pop slash
		if (path[path.length - 1] === '/') {
			path = path.substr(0, path.length - 1);
		}

		return path;
	}
function normalizePath (path) {
		// Remove double slashes
		if (path.indexOf('//') !== -1) {
			path = path.replace(/\/+/g, '/');
		}

		// Shift slash
		if (path[0] === '/') {
			path = path.substr(1);
		}
		
		// Pop slash
		if (path[path.length - 1] === '/') {
			path = path.substr(0, path.length - 1);
		}

		return path;
	}
function normalizePath ( path ) { // Remove double slashes if ( path . indexOf ( '//' ) !== - 1 ) { path = path . replace ( / \/+ / g , '/' ) ; } // Shift slash if ( path [ 0 ] === '/' ) { path = path . substr ( 1 ) ; } // Pop slash if ( path [ path . length - 1 ] === '/' ) { path = path . substr ( 0 , path . length - 1 ) ; } return path ; }
Normalizes given path by converting double frontslashes to singles
and removing the slashes from the beginning and end of the string.

@param  {String} path The path to normalize
@return {String}      Normalized path
Normalizes given path by converting double frontslashes to singles and removing the slashes from the beginning and end of the string .