From 46043305866a8c11d7886e02ec0716ac0d42ed97 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sun, 29 Dec 2019 23:17:38 +0100 Subject: [PATCH] handle count with number properly in packet test --- test/packetTest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/packetTest.js b/test/packetTest.js index 6d2c54e..bfa1893 100644 --- a/test/packetTest.js +++ b/test/packetTest.js @@ -44,7 +44,9 @@ const values = { buffer: Buffer.alloc(8), array: function (typeArgs, context) { let count - if (typeof typeArgs.count === 'object') { + if (typeof typeArgs.count === 'number') { + count = typeArgs.count + } else if (typeof typeArgs.count === 'object') { count = evalCount(typeArgs.count, context) } else if (typeArgs.count !== undefined) { count = getField(typeArgs.count, context)