From 41108a77d02ab73543a47580c9aae4929510f7a7 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Sat, 30 Mar 2024 17:12:29 -0400 Subject: [PATCH] Fix Buffer instance check in Tap#setData This should now work if Buffer is not defined --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 2f091634..a5d4c146 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -515,7 +515,7 @@ class Tap { } setData (buf, pos) { - if (buf instanceof Buffer) { + if (typeof Buffer === 'function' && buf instanceof Buffer) { buf = new Uint8Array(buf.buffer, buf.byteOffset, buf.length); } this.arr = buf;