Skip to content

Commit

Permalink
fix: weird typescript quirk in uint8 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilloftheshadow committed Oct 19, 2024
1 parent 74ad612 commit bb295fc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/carbon/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit bb295fc

Please sign in to comment.