refactor: align platform APIs with community review

This commit is contained in:
vorotamoroz
2026-07-17 14:47:27 +00:00
parent 298738fc67
commit 326bf77183
39 changed files with 444 additions and 294 deletions
+3 -6
View File
@@ -1,17 +1,14 @@
#!/usr/bin/env node
// eslint-disable -- This is the entry point for the CLI application.
import * as polyfill from "werift";
import { RTCPeerConnection } from "werift";
import { main } from "./main";
import { compatGlobal } from "@vrtmrz/livesync-commonlib/compat/common/coreEnvFunctions";
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Polyfill
const rtcPolyfillCtor = (polyfill as any).RTCPeerConnection;
if (
typeof (compatGlobal as unknown as Record<string, unknown>).RTCPeerConnection === "undefined" &&
typeof rtcPolyfillCtor === "function"
typeof RTCPeerConnection === "function"
) {
// Fill only the standard WebRTC global in Node CLI runtime.
(compatGlobal as unknown as Record<string, unknown>).RTCPeerConnection = rtcPolyfillCtor;
(compatGlobal as unknown as Record<string, unknown>).RTCPeerConnection = RTCPeerConnection;
}
main().catch((error) => {