Skip to content

Commit

Permalink
chore(api): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
heapwolf committed Jul 18, 2024
1 parent 8c35d17 commit 4a46b8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions api/latica/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ export class Peer {
const siblings = packet && [...this.cache.data.values()]
.filter(Boolean)
.filter(p => {
if (!p.previousId || !packet.packetId) return
if (!p.previousId || !packet.packetId) return false
return Buffer.from(p.previousId).compare(Buffer.from(packet.packetId)) === 0
})

Expand Down Expand Up @@ -1441,7 +1441,7 @@ export class Peer {
}

if (isConnection && natType) {
this._onDebug(`<- CONNECTION (source=ping)`)
this._onDebug('<- CONNECTION (source=ping)')
this._onConnection(packet, requesterPeerId, port, address)

message.isConnection = true
Expand Down Expand Up @@ -1485,7 +1485,7 @@ export class Peer {

if (packet.message.isConnection) {
if (pingId) peer.pingId = pingId
this._onDebug(`<- CONNECTION (source=pong)`)
this._onDebug('<- CONNECTION (source=pong)')
this._onConnection(packet, responderPeerId, port, address)
return
}
Expand Down Expand Up @@ -1663,7 +1663,7 @@ export class Peer {
const proxyCandidate = this.peers.find(p => p.peerId === packet.message.responderPeerId)

if (opts.attempts >= 2) {
this._onDebug(`<- CONNECTION (source=intro)`)
this._onDebug('<- CONNECTION (source=intro)')
this._onConnection(packet, peer.peerId, peerPort, peerAddress, proxyCandidate)
return false
}
Expand Down Expand Up @@ -1748,7 +1748,7 @@ export class Peer {
this._onMessage(msg, rinfo)
})

this._onDebug(`<- CONNECTION (source=intro)`)
this._onDebug('<- CONNECTION (source=intro)')
this._onConnection(packet, peer.peerId, rinfo.port, rinfo.address, undefined, pooledSocket)

const p = {
Expand Down Expand Up @@ -1785,7 +1785,7 @@ export class Peer {

if (strategy === NAT.STRATEGY_PROXY && !peer.proxy) {
// TODO could allow multiple proxies
this._onDebug(`<- CONNECTION (source=proxy)`)
this._onDebug('<- CONNECTION (source=proxy)')
this._onConnection(packet, peer.peerId, peerPort, peerAddress, proxyCandidate)
this._onDebug('++ INTRO CHOSE PROXY STRATEGY')
}
Expand Down Expand Up @@ -1992,7 +1992,7 @@ export class Peer {
this.mcast(packet, [{ port, address }, { port: peerPort, address: peerAddress }])

if (packet.hops <= 1) {
this._onDebug(`<- CONNECTION (source=join)`)
this._onDebug('<- CONNECTION (source=join)')
this._onConnection(packet, packet.message.requesterPeerId, port, address)
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/latica/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class PeerWorkerProxy {
const arg = args[i]

if (arg?.constructor.name === 'RemotePeer' || arg?.constructor.name === 'Peer') {
args[i] = { // what details we want to expose outside of the protocol
args[i] = { // what details we want to expose outside of the protocol
peerId: arg.peerId,
address: arg.address,
port: arg.port,
Expand Down

0 comments on commit 4a46b8f

Please sign in to comment.