mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-07-16 10:58:45 +00:00
Removed non-existant class in webOS 6.0/5.0 NodeJS runtime
This commit is contained in:
parent
4dc54346de
commit
98962984c6
1 changed files with 5 additions and 4 deletions
|
@ -36,16 +36,17 @@ export class FCastSession {
|
||||||
|
|
||||||
let data: Uint8Array;
|
let data: Uint8Array;
|
||||||
if (json) {
|
if (json) {
|
||||||
const utf8Encode = new TextEncoder();
|
// Do NOT use the TextEncoder utility class, it does not exist in the NodeJS runtime
|
||||||
data = utf8Encode.encode(json);
|
// for webOS 6.0 and earlier...
|
||||||
|
data = Buffer.from(json, 'utf8');
|
||||||
} else {
|
} else {
|
||||||
data = new Uint8Array(0);
|
data = Buffer.alloc(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const size = 1 + data.length;
|
const size = 1 + data.length;
|
||||||
const header = Buffer.alloc(4 + 1);
|
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
|
// so manually checking endianness and writing as LE
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (TARGET === 'webOS') {
|
if (TARGET === 'webOS') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue