From 10e4582886a45a3fb74fb3d3181b6fc4decc683b Mon Sep 17 00:00:00 2001 From: RealHandy Date: Tue, 28 May 2019 10:31:16 -0400 Subject: [PATCH] Fix for 'not yet supported' error when packing classes --- lib/binarypack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/binarypack.js b/lib/binarypack.js index 19629c6..68beb4f 100644 --- a/lib/binarypack.js +++ b/lib/binarypack.js @@ -300,7 +300,7 @@ Packer.prototype.pack = function(value){ } else { this.pack_bin(value.buffer); } - } else if (constructor == Object){ + } else if ((constructor == Object)||(constructor.toString().startsWith('class'))){ this.pack_object(value); } else if (constructor == Date){ this.pack_string(value.toString());