From b281167e8de332f8bbbb3bcefa5219e175ab169b Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Fri, 2 Jun 2023 13:57:46 +0000 Subject: [PATCH] Fix utf8ToBytes in firefox extension context --- src/abstract/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abstract/utils.ts b/src/abstract/utils.ts index cabbc19..00fc18f 100644 --- a/src/abstract/utils.ts +++ b/src/abstract/utils.ts @@ -140,7 +140,7 @@ declare const TextEncoder: any; */ export function utf8ToBytes(str: string): Uint8Array { if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new TextEncoder().encode(str); + return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 } // Bit operations