function parseURL$6(url) {
    if (isInt$1(url)) {
        return { port: url };
    }
    let parsed = url_1.parse(url, true, true);
    if (!parsed.slashes && url[0] !== "/") {
        url = "//" + url;
        parsed = url_1.parse(url, true, true);
    }
    const options = parsed.query || {};
    const allowUsernameInURI = options.allowUsernameInURI && options.allowUsernameInURI !== "false";
    delete options.allowUsernameInURI;
    const result = {};
    if (parsed.auth) {
        const index = parsed.auth.indexOf(":");
        if (allowUsernameInURI) {
            result.username =
                index === -1 ? parsed.auth : parsed.auth.slice(0, index);
        }
        result.password = index === -1 ? "" : parsed.auth.slice(index + 1);
    }
    if (parsed.pathname) {
        if (parsed.protocol === "redis:" || parsed.protocol === "rediss:") {
            if (parsed.pathname.length > 1) {
                result.db = parsed.pathname.slice(1);
            }
        }
        else {
            result.path = parsed.pathname;
        }
    }
    if (parsed.host) {
        result.host = parsed.hostname;
    }
    if (parsed.port) {
        result.port = parsed.port;
    }
    lodash_1$2.defaults(result, options);
    return result;
}
Parse the redis protocol url

@param {string} url - the redis protocol url
@return {Object}