* Validates the protocol options. * @param {ClientOptions.protocolOptions} protocolOptions * @private
(protocolOptions)
| 227 | * @private |
| 228 | */ |
| 229 | function validateProtocolOptions(protocolOptions) { |
| 230 | if (!protocolOptions) { |
| 231 | throw new TypeError('protocolOptions not defined in options'); |
| 232 | } |
| 233 | const version = protocolOptions.maxVersion; |
| 234 | if (version && (typeof version !== 'number' || !types.protocolVersion.isSupported(version))) { |
| 235 | throw new TypeError(util.format('protocolOptions.maxVersion provided (%s) is invalid', version)); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * Validates the socket options. |