diff options
author | Matthew Miller <matthew@millerti.me> | 2022-11-11 15:58:07 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-11-11 15:58:07 -0800 |
commit | 9d99d934050cd3d24cc8965fcc75d27cd3f37b8e (patch) | |
tree | 23517eaaa66ad50cbfaf25e9b8aee26ea875c4c8 | |
parent | 86e86b3b3ca2583981278ebfe700d415af9b402c (diff) |
Be explicit about globalThis in string encoding
-rw-r--r-- | packages/server/src/helpers/uint8array.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/helpers/uint8array.ts b/packages/server/src/helpers/uint8array.ts index f12e9b0..f33e913 100644 --- a/packages/server/src/helpers/uint8array.ts +++ b/packages/server/src/helpers/uint8array.ts @@ -73,7 +73,7 @@ export function toUTF8String(array: Uint8Array): string { * well...I'll deal with that case if it happens. */ // @ts-ignore 2304 - const decoder: _TextDecoder = new TextDecoder("utf-8"); + const decoder: _TextDecoder = new globalThis.TextDecoder("utf-8"); return decoder.decode(array); } @@ -91,7 +91,7 @@ export function fromUTF8String(utf8String: string): Uint8Array { * well...I'll deal with that case if it happens. */ // @ts-ignore 2304 - const encoder: _TextEncoder = new TextEncoder(); + const encoder: _TextEncoder = new globalThis.TextEncoder(); return encoder.encode(utf8String); } |