Skip to content

Commit

Permalink
New instance of fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Aug 23, 2023
1 parent 84d5142 commit 88e12ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/util/src/u8a/toBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ import { hasBuffer } from '../has.js';
export function u8aToBuffer <T = BufferObject> (value?: Uint8Array | null): T {
return hasBuffer
? (xglobal.Buffer as unknown as BufferClass).from(value || [])
: (value || new Uint8Array()) as T;
: new Uint8Array(value || []) as T;
}

0 comments on commit 88e12ac

Please sign in to comment.