From 6729be58a53a459da31c44fafee3bae75dc07294 Mon Sep 17 00:00:00 2001 From: Victor Manuel Puga Ruiz <39507381+VictorPuga@users.noreply.github.com> Date: Fri, 10 Nov 2023 00:53:28 -0600 Subject: [PATCH] Improve compatibility with Next.js (#94) --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 8f286e4..22f4499 100644 --- a/index.js +++ b/index.js @@ -93,8 +93,7 @@ const destroyCircular = ({ }); for (const [key, value] of Object.entries(from)) { - // eslint-disable-next-line node/prefer-global/buffer - if (typeof Buffer === 'function' && Buffer.isBuffer(value)) { + if (value && value instanceof Uint8Array && value.constructor.name === 'Buffer') { to[key] = '[object Buffer]'; continue; }