source/request.js
function encodePath(path) {
    const replaced = path.replace(/\//g, SEP_PATH_POSIX).replace(/\\\\/g, SEP_PATH_WINDOWS);
    const formatted = encodeURIComponent(replaced);
    return formatted
        .split(SEP_PATH_WINDOWS)
        .join("\\\\")
        .split(SEP_PATH_POSIX)
        .join("/");
}
function encodePath(path) {
    const replaced = path.replace(/\//g, SEP_PATH_POSIX).replace(/\\\\/g, SEP_PATH_WINDOWS);
    const formatted = encodeURIComponent(replaced);
    return formatted
        .split(SEP_PATH_WINDOWS)
        .join("\\\\")
        .split(SEP_PATH_POSIX)
        .join("/");
}
function encodePath ( path ) { const replaced = path . replace ( / \/ / g , SEP_PATH_POSIX ) . replace ( / \\\\ / g , SEP_PATH_WINDOWS ) ; const formatted = encodeURIComponent ( replaced ) ; return formatted . split ( SEP_PATH_WINDOWS ) . join ( "\\\\" ) . split ( SEP_PATH_POSIX ) . join ( "/" ) ; }
Encode a path for use with WebDAV servers
@param {String} path The path to encode
@returns {String} The encoded path (separators protected)
Encode a path for use with WebDAV servers