| 8061 | if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { |
| 8062 | throw new InvalidArgumentError("maxRedirections must be a positive number"); |
| 8063 | } |
| 8064 | if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { |
| 8065 | throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); |
| 8066 | } |
| 8067 | if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) { |
| 8068 | throw new InvalidArgumentError("localAddress must be valid string IP address"); |
| 8069 | } |
| 8070 | if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { |
| 8071 | throw new InvalidArgumentError("maxResponseSize must be a positive number"); |
| 8072 | } |
| 8073 | if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) { |
| 8074 | throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number"); |
| 8075 | } |
| 8076 | if (allowH2 != null && typeof allowH2 !== "boolean") { |
| 8077 | throw new InvalidArgumentError("allowH2 must be a valid boolean value"); |
| 8078 | } |
| 8079 | if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) { |
| 8080 | throw new InvalidArgumentError("maxConcurrentStreams must be a positive integer, greater than 0"); |
| 8081 | } |
| 8082 | if (typeof connect2 !== "function") { |
| 8083 | connect2 = buildConnector(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, tls), { |
| 8084 | maxCachedSessions, |
| 8085 | allowH2, |
| 8086 | socketPath, |
| 8087 | timeout: connectTimeout |
| 8088 | }), autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0), connect2)); |
| 8089 | } |
| 8090 | if ((interceptors == null ? void 0 : interceptors.Client) && Array.isArray(interceptors.Client)) { |