From cb759ddc7fa97737b2473be1e132415cc942767a Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Sun, 10 Dec 2023 23:04:49 +0000 Subject: [PATCH] utils: improve isBytes --- src/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 3fdb837..28d4df7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -19,9 +19,8 @@ export const u32 = (arr: TypedArray) => function isBytes(a: unknown): a is Uint8Array { return ( - a != null && - typeof a === 'object' && - (a instanceof Uint8Array || a.constructor.name === 'Uint8Array') + a instanceof Uint8Array || + (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array') ); }