docs: function getSocketAddressFromURLSafeHostname(hostname) {
      return __awaiter(this, void 0, void 0, function* () {
          // IPv4 addresses are fine
          if (net_1.isIPv4(hostname))
              return hostname;
          // IPv6 addresses are wrapped in [], which need to be removed
          if (/^\[.+\]$/.test(hostname)) {
              const potentialIPv6 = hostname.slice(1, -1);
              if (net_1.isIPv6(potentialIPv6))
                  return potentialIPv6;
          }
          // This is a hostname, look it up
          try {
              const address = yield lookupAsync(hostname);
              // We found an address
              if (address)
                  return address;
          }
          catch (e) {
              // Lookup failed, continue working with the hostname
          }
          return hostname;
      });
  }