From da2f09bd9b9acebac9757de586c1394bbe49b3d9 Mon Sep 17 00:00:00 2001 From: Brian Shannon Date: Thu, 10 Nov 2022 12:32:11 +0000 Subject: [PATCH] Update stringify.js with Buffer formatter --- src/stringify.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stringify.js b/src/stringify.js index a32bfc2..3e7dd25 100644 --- a/src/stringify.js +++ b/src/stringify.js @@ -115,7 +115,9 @@ module.exports = function stringify(input, options, pad) { if (input instanceof Date) { return `Date(${input.toJSON()})`; } - + if( Buffer.isBuffer(input)){ + return `Buffer[ ${Array.from(input).join()} ]`; + } if (Array.isArray(input) || input instanceof Set) { let typeOfObj = "" if(input instanceof Set){