diff --git a/__test__/faker.ts b/__test__/faker.ts index dc1023451..3a1800a90 100644 --- a/__test__/faker.ts +++ b/__test__/faker.ts @@ -4,7 +4,7 @@ import "webrtc-adapter"; const fakeGlobals = { WebSocket, MediaStream: class MediaStream { - private _tracks: MediaStreamTrack[] = []; + private readonly _tracks: MediaStreamTrack[] = []; constructor(tracks?: MediaStreamTrack[]) { if (tracks) { diff --git a/e2e/datachannel/serialization_cbor.spec.ts b/e2e/datachannel/serialization_cbor.spec.ts index 875812f6a..a04f0468f 100644 --- a/e2e/datachannel/serialization_cbor.spec.ts +++ b/e2e/datachannel/serialization_cbor.spec.ts @@ -1,6 +1,6 @@ import P from "./serialization.page.js"; import { serializationTest } from "./serializationTest.js"; -import { browser, $, $$, expect } from "@wdio/globals"; +import { browser } from "@wdio/globals"; describe("DataChannel:CBOR", function () { beforeAll(async function () { diff --git a/lib/baseconnection.ts b/lib/baseconnection.ts index d80857f0e..061960de7 100644 --- a/lib/baseconnection.ts +++ b/lib/baseconnection.ts @@ -51,7 +51,7 @@ export abstract class BaseConnection< return this._open; } - constructor( + protected constructor( /** * The ID of the peer on the other end of this connection. */ diff --git a/lib/dataconnection/StreamConnection/Cbor.ts b/lib/dataconnection/StreamConnection/Cbor.ts index df7014707..1f4604601 100644 --- a/lib/dataconnection/StreamConnection/Cbor.ts +++ b/lib/dataconnection/StreamConnection/Cbor.ts @@ -56,7 +56,7 @@ export class Cbor extends StreamConnection { constructor(peerId: string, provider: Peer, options: any) { super(peerId, provider, { ...options, reliable: true }); - this._rawReadStream.pipeTo(this._decoderStream.writable); + void this._rawReadStream.pipeTo(this._decoderStream.writable); (async () => { for await (const msg of iterateOver(this._decoderStream.readable)) { diff --git a/lib/dataconnection/StreamConnection/StreamConnection.ts b/lib/dataconnection/StreamConnection/StreamConnection.ts index 6fc01f53b..6a8203c40 100644 --- a/lib/dataconnection/StreamConnection/StreamConnection.ts +++ b/lib/dataconnection/StreamConnection/StreamConnection.ts @@ -40,12 +40,6 @@ export abstract class StreamConnection extends DataConnection { start: (controller) => { this.once("open", () => { this.dataChannel.addEventListener("message", (e) => { - // if(e.data?.__peerData?.type === "close") - // { - // controller.close() - // this.close() - // return - // } controller.enqueue(e.data); }); }); @@ -55,7 +49,7 @@ export abstract class StreamConnection extends DataConnection { protected constructor(peerId: string, provider: Peer, options: any) { super(peerId, provider, { ...options, reliable: true }); - this._splitStream.readable.pipeTo(this._rawSendStream); + void this._splitStream.readable.pipeTo(this._rawSendStream); } public override _initializeDataChannel(dc) { diff --git a/lib/mediaconnection.ts b/lib/mediaconnection.ts index b15357174..a2dd10574 100644 --- a/lib/mediaconnection.ts +++ b/lib/mediaconnection.ts @@ -100,11 +100,11 @@ export class MediaConnection extends BaseConnection { switch (message.type) { case ServerMessageType.Answer: // Forward to negotiator - this._negotiator.handleSDP(type, payload.sdp); + void this._negotiator.handleSDP(type, payload.sdp); this._open = true; break; case ServerMessageType.Candidate: - this._negotiator.handleCandidate(payload.candidate); + void this._negotiator.handleCandidate(payload.candidate); break; default: logger.warn(`Unrecognized message type:${type} from peer:${this.peer}`); diff --git a/lib/negotiator.ts b/lib/negotiator.ts index 44f72878e..ab630b14c 100644 --- a/lib/negotiator.ts +++ b/lib/negotiator.ts @@ -37,9 +37,9 @@ export class Negotiator< ); dataConnection._initializeDataChannel(dataChannel); - this._makeOffer(); + void this._makeOffer(); } else { - this.handleSDP("OFFER", options.sdp); + void this.handleSDP("OFFER", options.sdp); } } diff --git a/package.json b/package.json index fa1ebcbcb..b0328ce0c 100644 --- a/package.json +++ b/package.json @@ -151,9 +151,8 @@ "source": "lib/global.ts" }, "browser-minified-cbor": { - "context": "node", + "context": "browser", "outputFormat": "esmodule", - "includeNodeModules": true, "isLibrary": true, "optimize": true, "engines": { @@ -164,7 +163,6 @@ "browser-minified-msgpack": { "context": "browser", "outputFormat": "esmodule", - "includeNodeModules": true, "isLibrary": true, "optimize": true, "engines": {