Skip to content

Commit 8222ccd

Browse files
authored
style: use object shorthand for properties (webtorrent#400)
1 parent 892b848 commit 8222ccd

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/client/http-tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class HTTPTracker extends Tracker {
125125

126126
let request = get.concat({
127127
url: parsedUrl.toString(),
128-
agent: agent,
128+
agent,
129129
timeout: common.REQUEST_TIMEOUT,
130130
headers: {
131131
'user-agent': this.client._userAgent || ''

lib/client/udp-tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class UDPTracker extends Tracker {
258258

259259
function send (message, proxyInfo) {
260260
if (proxyInfo) {
261-
const pack = Socks.createUDPFrame({ host: hostname, port: port }, message)
261+
const pack = Socks.createUDPFrame({ host: hostname, port }, message)
262262
socket.send(pack, 0, pack.length, proxyInfo.port, proxyInfo.host)
263263
} else {
264264
socket.send(message, 0, message.length, port, hostname)

lib/client/websocket-tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class WebSocketTracker extends Tracker {
186186
agent = new Socks.Agent(clone(this.client._proxyOpts.socksProxy), (parsedUrl.protocol === 'wss:'))
187187
}
188188
}
189-
this.socket = socketPool[this.announceUrl] = new Socket({ url: this.announceUrl, agent: agent })
189+
this.socket = socketPool[this.announceUrl] = new Socket({ url: this.announceUrl, agent })
190190
this.socket.consumers = 1
191191
this.socket.once('connect', this._onSocketConnectBound)
192192
}

test/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ function testClientStartHttpAgent (t, serverType) {
582582
infoHash: fixtures.leaves.parsedTorrent.infoHash,
583583
announce: announceUrl,
584584
peerId: peerId1,
585-
port: port,
585+
port,
586586
wrtc: {},
587587
proxyOpts: {
588588
httpAgent: agent

0 commit comments

Comments
 (0)