1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Removed non-existant class in webOS 6.0/5.0 NodeJS runtime

This commit is contained in:
Michael Hollister 2025-02-19 01:47:36 -06:00
parent 4dc54346de
commit 98962984c6

View file

@ -36,16 +36,17 @@ export class FCastSession {
let data: Uint8Array;
if (json) {
const utf8Encode = new TextEncoder();
data = utf8Encode.encode(json);
// Do NOT use the TextEncoder utility class, it does not exist in the NodeJS runtime
// for webOS 6.0 and earlier...
data = Buffer.from(json, 'utf8');
} else {
data = new Uint8Array(0);
data = Buffer.alloc(0);
}
const size = 1 + data.length;
const header = Buffer.alloc(4 + 1);
// Web OS 22 and earlier node versions do not support `writeUint32LE`,
// webOS 22 and earlier node versions do not support `writeUint32LE`,
// so manually checking endianness and writing as LE
// @ts-ignore
if (TARGET === 'webOS') {