Skip to content

Commit

Permalink
style: run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgloning committed Aug 8, 2023
1 parent ffe47d8 commit 51baaff
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion __test__/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion e2e/datachannel/serialization_cbor.spec.ts
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion lib/baseconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/dataconnection/StreamConnection/Cbor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
8 changes: 1 addition & 7 deletions lib/dataconnection/StreamConnection/StreamConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/mediaconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ export class MediaConnection extends BaseConnection<MediaConnectionEvents> {
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}`);
Expand Down
4 changes: 2 additions & 2 deletions lib/negotiator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@
"source": "lib/global.ts"
},
"browser-minified-cbor": {
"context": "node",
"context": "browser",
"outputFormat": "esmodule",
"includeNodeModules": true,
"isLibrary": true,
"optimize": true,
"engines": {
Expand All @@ -164,7 +163,6 @@
"browser-minified-msgpack": {
"context": "browser",
"outputFormat": "esmodule",
"includeNodeModules": true,
"isLibrary": true,
"optimize": true,
"engines": {
Expand Down

0 comments on commit 51baaff

Please sign in to comment.