diff options
author | Antoine Cormouls <contact.antoine.cormouls@gmail.com> | 2020-12-21 15:07:41 +0100 |
---|---|---|
committer | Antoine Cormouls <contact.antoine.cormouls@gmail.com> | 2020-12-21 15:07:41 +0100 |
commit | e63ed0d6a2c51e86ce37e6a5e124c2feb124e9f4 (patch) | |
tree | b3ffc31c1d4c5cfd8e9e05bcd325f849d9db48ab /packages/browser/src/helpers/toUint8Array.ts | |
parent | 973797b1351829bae24ad42ae2bdddcebc6c518a (diff) |
remove global text encoder
Diffstat (limited to 'packages/browser/src/helpers/toUint8Array.ts')
-rw-r--r-- | packages/browser/src/helpers/toUint8Array.ts | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/packages/browser/src/helpers/toUint8Array.ts b/packages/browser/src/helpers/toUint8Array.ts index 1855dd7..1e2243f 100644 --- a/packages/browser/src/helpers/toUint8Array.ts +++ b/packages/browser/src/helpers/toUint8Array.ts @@ -1,9 +1,7 @@ -const utf8Encoder = new TextEncoder(); - /** * A helper method to convert an arbitrary string sent from the server to a Uint8Array the * authenticator will expect. */ export default function toUint8Array(value: string): Uint8Array { - return utf8Encoder.encode(value); + return new TextEncoder().encode(value); } |