style: use object shorthand for properties (#400)

This commit is contained in:
Linus Unnebäck 2021-10-29 16:36:47 +02:00 committed by GitHub
parent 892b848911
commit 8222ccd1d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -125,7 +125,7 @@ class HTTPTracker extends Tracker {
let request = get.concat({ let request = get.concat({
url: parsedUrl.toString(), url: parsedUrl.toString(),
agent: agent, agent,
timeout: common.REQUEST_TIMEOUT, timeout: common.REQUEST_TIMEOUT,
headers: { headers: {
'user-agent': this.client._userAgent || '' 'user-agent': this.client._userAgent || ''

View File

@ -258,7 +258,7 @@ class UDPTracker extends Tracker {
function send (message, proxyInfo) { function send (message, proxyInfo) {
if (proxyInfo) { if (proxyInfo) {
const pack = Socks.createUDPFrame({ host: hostname, port: port }, message) const pack = Socks.createUDPFrame({ host: hostname, port }, message)
socket.send(pack, 0, pack.length, proxyInfo.port, proxyInfo.host) socket.send(pack, 0, pack.length, proxyInfo.port, proxyInfo.host)
} else { } else {
socket.send(message, 0, message.length, port, hostname) socket.send(message, 0, message.length, port, hostname)

View File

@ -186,7 +186,7 @@ class WebSocketTracker extends Tracker {
agent = new Socks.Agent(clone(this.client._proxyOpts.socksProxy), (parsedUrl.protocol === 'wss:')) agent = new Socks.Agent(clone(this.client._proxyOpts.socksProxy), (parsedUrl.protocol === 'wss:'))
} }
} }
this.socket = socketPool[this.announceUrl] = new Socket({ url: this.announceUrl, agent: agent }) this.socket = socketPool[this.announceUrl] = new Socket({ url: this.announceUrl, agent })
this.socket.consumers = 1 this.socket.consumers = 1
this.socket.once('connect', this._onSocketConnectBound) this.socket.once('connect', this._onSocketConnectBound)
} }

View File

@ -582,7 +582,7 @@ function testClientStartHttpAgent (t, serverType) {
infoHash: fixtures.leaves.parsedTorrent.infoHash, infoHash: fixtures.leaves.parsedTorrent.infoHash,
announce: announceUrl, announce: announceUrl,
peerId: peerId1, peerId: peerId1,
port: port, port,
wrtc: {}, wrtc: {},
proxyOpts: { proxyOpts: {
httpAgent: agent httpAgent: agent