From 66a278499bb12c1e0f3c5efc7895c790ff309992 Mon Sep 17 00:00:00 2001 From: Rafael Cardenas Date: Thu, 26 Oct 2023 10:19:23 -0600 Subject: [PATCH] fix: buffer to hex --- src/helpers/values.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/helpers/values.ts b/src/helpers/values.ts index 548ca67..6f7dd98 100644 --- a/src/helpers/values.ts +++ b/src/helpers/values.ts @@ -52,10 +52,7 @@ export function parseBoolean(val: string | undefined | null): boolean { * is zero length. */ export function bufferToHex(buff: Buffer, prefix: boolean = true): string { - if (buff.length === 0) { - return ''; - } - return prefix ? '0x' : '' + buff.toString('hex'); + return buff.length === 0 ? '' : (prefix ? '0x' : '') + buff.toString('hex'); } /**