From 7b72c17da2dde8f33db7b0547e919e6263770ac9 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Thu, 7 Nov 2024 16:02:09 +0100 Subject: [PATCH] fix: potential buffer string interpolation --- src/utils/node_byte_utils.ts | 2 +- src/utils/web_byte_utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/node_byte_utils.ts b/src/utils/node_byte_utils.ts index ca1482ca..7836345f 100644 --- a/src/utils/node_byte_utils.ts +++ b/src/utils/node_byte_utils.ts @@ -83,7 +83,7 @@ export const nodeJsByteUtils = { return Buffer.from(potentialBuffer); } - throw new BSONError(`Cannot create Buffer from ${String(potentialBuffer)}`); + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); }, allocate(size: number): NodeJsBuffer { diff --git a/src/utils/web_byte_utils.ts b/src/utils/web_byte_utils.ts index 0f79f0df..9d9c343f 100644 --- a/src/utils/web_byte_utils.ts +++ b/src/utils/web_byte_utils.ts @@ -100,7 +100,7 @@ export const webByteUtils = { return new Uint8Array(potentialUint8array); } - throw new BSONError(`Cannot make a Uint8Array from ${String(potentialUint8array)}`); + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); }, allocate(size: number): Uint8Array {