From ca97de4cf33bcc40e354a36e8e2fff087ecb611a Mon Sep 17 00:00:00 2001 From: L <6723574+louisgv@users.noreply.github.com> Date: Tue, 27 Sep 2022 17:50:10 -0700 Subject: [PATCH] fix: writeStringArray has wrong check `!strings instanceof Array` is parsed as `(!strings) instanceof Array`, which is not what this should check for. The `!` need to be outside to actually test the instance type first. --- lib/ber/writer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ber/writer.js b/lib/ber/writer.js index 3515acf..0e9cae4 100644 --- a/lib/ber/writer.js +++ b/lib/ber/writer.js @@ -161,7 +161,7 @@ Writer.prototype.writeBuffer = function (buf, tag) { Writer.prototype.writeStringArray = function (strings) { - if ((!strings instanceof Array)) + if (!(strings instanceof Array)) throw new TypeError('argument must be an Array[String]'); var self = this;