Skip to content

Commit

Permalink
utils: improve isBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Dec 10, 2023
1 parent d5c624a commit cb759dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
);
}

Expand Down

0 comments on commit cb759dd

Please sign in to comment.