diff options
author | Matthew Miller <matthew@millerti.me> | 2020-12-31 10:58:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-31 10:58:37 -0800 |
commit | e6d6ca17178513cdde58c0aff9b3017ba12c5a81 (patch) | |
tree | b3ffc31c1d4c5cfd8e9e05bcd325f849d9db48ab /packages/browser/src/helpers/toUint8Array.ts | |
parent | 973797b1351829bae24ad42ae2bdddcebc6c518a (diff) | |
parent | e63ed0d6a2c51e86ce37e6a5e124c2feb124e9f4 (diff) |
Merge pull request #87 from Moumouls/moumouls/lazy-load-text-encoder
Lazy 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); } |