From bb295fcd6535a90bf1b7d4885ce55343da1750d2 Mon Sep 17 00:00:00 2001 From: Shadow Date: Sat, 19 Oct 2024 10:27:27 -0500 Subject: [PATCH] fix: weird typescript quirk in uint8 checks --- packages/carbon/src/utils.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/carbon/src/utils.ts b/packages/carbon/src/utils.ts index 7f507360..786e6208 100644 --- a/packages/carbon/src/utils.ts +++ b/packages/carbon/src/utils.ts @@ -56,11 +56,9 @@ export function valueToUint8Array( return new TextEncoder().encode(value) } - try { - if (Buffer.isBuffer(value)) { - return new Uint8Array(value) - } - } catch (_) {} + if (Buffer.isBuffer(value)) { + return new Uint8Array(value) + } if (value instanceof ArrayBuffer) { return new Uint8Array(value) }