format(connectionStringObject) {
    if (!connectionStringObject) {
      return this.scheme + "://localhost";
    }
    if (
      this.scheme &&
      connectionStringObject.scheme &&
      this.scheme !== connectionStringObject.scheme
    ) {
      throw new Error(`Scheme not supported: ${connectionStringObject.scheme}`);
    }

    let uri =
      (this.scheme ||
        connectionStringObject.scheme ||
        ConnectionStringParser.DEFAULT_SCHEME) + "://";

    if (connectionStringObject.username) {
      uri += encodeURIComponent(connectionStringObject.username);
      // Allow empty passwords
      if (connectionStringObject.password) {
        uri += ":" + encodeURIComponent(connectionStringObject.password);
      }
      uri += "@";
    }
    uri += this._formatAddress(connectionStringObject);
    // Only put a slash when there is an endpoint
    if (connectionStringObject.endpoint) {
      uri += "/" + encodeURIComponent(connectionStringObject.endpoint);
    }
    if (
      connectionStringObject.options &&
      Object.keys(connectionStringObject.options).length > 0
    ) {
      uri +=
        "?" +
        Object.keys(connectionStringObject.options)
          .map(
            (option) =>
              encodeURIComponent(option) +
              "=" +
              encodeURIComponent(connectionStringObject.options[option])
          )
          .join("&");
    }
    return uri;
  }
Takes a connection string object and returns a URI string of the form:

scheme://[username[:password]@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[endpoint]][?options]
@param {Object} connectionStringObject The object that describes connection string parameters