Replaces Windows path separators ("\") with URL path separators ("/").

@param {string} p
@returns {string}
509854
function normalizeSeparators (p) {
  p = p || "";

  if (path.sep === "\\") {
    // Replace backslashes with forward slashes
    return p.replace(/\\/g, "/");
  }
  else {
    // Return the path as-is, since it should already have proper URL separators.
    // If it DOES contain backslashes, then they are treated as normal characters,
    // NOT as separators
    return p;
  }
}
921952
function formatPath(urlobj)
{
	var path = urlobj.pathname;
	
	if (urlobj.search !== null)
	{
		path += urlobj.search;
	}
	
	return path;
}
1320339
public static String separatorsToSystem(final String path)
    {
        if (path == null)
        {
            return null;
        }
        if (isSystemWindows())
        {
            return separatorsToWindows(path);
        }
        else
        {
            return separatorsToUnix(path);
        }
    }
499587
function _splitPath (keys) {
  var out

  if (util.isString(keys)) {
    out = []
    keys
      .split('.')
      .map(_segment('.'))
      .forEach(function (k) {
        k = (k || ' ').trim()
          .replace(/^([^[]+)\[(["']?)(.+)\2\]$/, function (m, m1, m2, m3) {
            if (m1 && m3) {
              out.push(m1, m3)
            }
            return ''
          })
        if (k) {
          out.push(k)
        }
      })
    keys = out
  }
  return keys
}
166225
public static String asPath(String path) {
        if (path == null) {
            return null;
        }

        // On windows we have to replace the backslash
        if (!File.separator.equals(FileUtil.URI_SEPARATOR_CHAR)) {
            return path.replace(File.separator, FileUtil.URI_SEPARATOR_CHAR);
        } else {
            return path;
        }
    }
1329035
function stripFileProtocol (url) {
  var isFileUrl = url.substr(0, 7).toLowerCase() === 'file://';

  if (isFileUrl) {
    // Strip-off the protocol, and the initial "/", if there is one
    url = url[7] === '/' ? url.substr(8) : url.substr(7);

    if (isWindows) {
      // Insert a colon (":") after the drive letter, if necessary
      if (url[1] === '/') {
        url = url[0] + ':' + url.substr(1);
      }
    }
    else {
      // It's a Posix path, so start at root
      url = '/' + url;
    }
  }

  return url;
}
679934
function (p, cb) {
				var pth = p.replace(/\\\?/g, '\/'); // Glob must use / as path seperator even on windows
				glob(pth + '/**/*.*', function (er, files) {
					if (er) {
						return cb(er);
					}
					return cb(null, files.map(function (f) {
						return path.relative(p, f);
					}));
				});
			}
1268532
function reparsePath(oldpath) {
        if (oldpath.indexOf("?") >= 0) {
            var vars = oldpath.split("?")[1].split("&");
            var result = oldpath.split("?")[0] + '?';
            var firstFlag = 0;
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (ignoredParams.search(pair[0]) < 0) {
                    if (firstFlag === 0) {
                        result = result + pair[0] + '=' + pair[1];
                        firstFlag = 1;
                    }
                    else {
                        result = result + '&' + pair[0] + '=' + pair[1];
                    }
                }
            }
            return result;
        }
        else {
            return oldpath;
        }
    }
396323
function( url ) {
			var parts = this.path.split('/'),
				other_parts = url.split('/'),
				result = '';
			while ( parts.length > 0 && other_parts.length > 0 && parts[0] == other_parts[0] ) {
				parts.shift();
				other_parts.shift();
			}
			each(other_parts, function(){ result += '../'; })
			return result + parts.join('/');
		}
1121437
function relativePath(from, to) {
  // console.log('relativePath:from: ' + from);
  // console.log('relativePath:to: ' + to);
  var relative = path.relative(from, to);
  if (!relative || relative.length < 1) {
    return relative;
  }
  var first = relative.substr(0, 1);
  if (first !== '.' && first !== '/') {
    relative = './' + relative;
  }

  // especially used for windows
  relative = relative.split(path.sep).join('/');

  return relative;
}
264084
function (path) {
        if (path[path.length - 1] === '/') {
            path = path.substr(0, path.length - 1);
        }
        return path;
    }
222859
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, '/');
}
770346
function (srcPath, options) {
        _.defaults(options || (options = {}), DEFAULT_OPTIONS);
        var separator = options.separator;
        var heads = options.heads;

        return _.some(_.map(heads, function (head) {
            var reg = new RegExp('^' + head + separator + '.+\\.styl$');
            return reg.test(path.basename(srcPath));
        }));
    }
651893
function( path ) {
      var normalized = [];
      var parts = path.split( '/' );

      for( var i = 0; i < parts.length; i++ ) {
         if( parts[i] === '.' ) {
            continue;
         }

         if( parts[i] === '..' && normalized.length && normalized[normalized.length - 1] !== '..' ) {
            normalized.pop();
            continue;
         }

         normalized.push( parts[i] );
      }

      return normalized.join( '/' );
   }
851457
function (path) {
                var absolute = path.charAt(0) === '/', trailingSlash = path.slice(0 - 1) === '/';
                path = normalizeArray(splitPathToArray(path), !absolute).join('/');
                if (!path && !absolute) {
                    path = '.';
                }
                if (path && trailingSlash) {
                    path += '/';
                }
                return (absolute ? '/' : '') + path;
            }
646805
function(path, params) {
        var queryString = this.query_string;
        for (var param in params) {
            var re = new RegExp(":"+ param)
            var found = false;
            if (path.search(re) != -1) {
                path = path.replace(re, params[param]);
                found = true;
            }
            for (var query in queryString) {
                if (queryString[query].search
                    && queryString[query].search(re) != -1) {
                    queryString[query] = queryString[query].replace(re, params[param]);
                    found = true;
                }
            }
            // exclude params in headers
            for (var header in this.headers) {
                if (this.headers[header].search(re) != -1) {
                    found = true;
                }
            }
            if (!found)
                queryString[param] = params[param];
        }
        var query = querystring.stringify(queryString);
        return path + ((query != "") ? "?"+ query : "");
    }
192158
function getPathDirectory(length, parts) {
  if (!parts) {
    return '';
  }
  return parts
    .slice(length)
    .filter(part => part !== '')
    .join(path.sep);
}