From 96b5b8eabac91519685e76069d87560db023912b Mon Sep 17 00:00:00 2001 From: Tomas Della Vedova Date: Wed, 30 Mar 2022 13:34:36 +0200 Subject: [PATCH] More lenient parameter checks (#1662) --- src/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.ts b/src/client.ts index 92650608a..0c12c1968 100644 --- a/src/client.ts +++ b/src/client.ts @@ -186,15 +186,15 @@ export default class Client extends API { maxCompressedResponseSize: null }, opts) - if (options.caFingerprint !== null && isHttpConnection(opts.node ?? opts.nodes)) { + if (options.caFingerprint != null && isHttpConnection(opts.node ?? opts.nodes)) { throw new errors.ConfigurationError('You can\'t configure the caFingerprint with a http connection') } - if (options.maxResponseSize !== null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) { + if (options.maxResponseSize != null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) { throw new errors.ConfigurationError(`The maxResponseSize cannot be bigger than ${buffer.constants.MAX_STRING_LENGTH}`) } - if (options.maxCompressedResponseSize !== null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) { + if (options.maxCompressedResponseSize != null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) { throw new errors.ConfigurationError(`The maxCompressedResponseSize cannot be bigger than ${buffer.constants.MAX_LENGTH}`) }