Skip to content

Commit 1a075bd

Browse files
committed
standard
1 parent db4a06d commit 1a075bd

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Client extends EventEmitter {
6262
this._wrtc = typeof opts.wrtc === 'function' ? opts.wrtc() : opts.wrtc
6363

6464
let announce = typeof opts.announce === 'string'
65-
? [ opts.announce ]
65+
? [opts.announce]
6666
: opts.announce == null ? [] : opts.announce
6767

6868
// Remove trailing slash from trackers to catch duplicates

lib/client/udp-tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class UDPTracker extends Tracker {
176176
}
177177
const infoHashes = (Array.isArray(opts.infoHash) && opts.infoHash.length > 0)
178178
? opts.infoHash.map(infoHash => { return infoHash.toString('hex') })
179-
: [ (opts.infoHash && opts.infoHash.toString('hex')) || self.client.infoHash ]
179+
: [(opts.infoHash && opts.infoHash.toString('hex')) || self.client.infoHash]
180180

181181
for (let i = 0, len = (msg.length - 8) / 12; i < len; i += 1) {
182182
self.client.emit('scrape', {

lib/common-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports.IPV4_RE = /^[\d.]+$/
1010
exports.IPV6_RE = /^[\da-fA-F:]+$/
1111
exports.REMOVE_IPV4_MAPPED_IPV6_RE = /^::ffff:/
1212

13-
exports.CONNECTION_ID = Buffer.concat([ toUInt32(0x417), toUInt32(0x27101980) ])
13+
exports.CONNECTION_ID = Buffer.concat([toUInt32(0x417), toUInt32(0x27101980)])
1414
exports.ACTIONS = { CONNECT: 0, ANNOUNCE: 1, SCRAPE: 2, ERROR: 3 }
1515
exports.EVENTS = { update: 0, completed: 1, started: 2, stopped: 3 }
1616
exports.EVENT_IDS = {

lib/server/parse-http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function parseHttpRequest (req, opts) {
4242
} else if (opts.action === 'scrape' || s[0] === '/scrape') {
4343
params.action = common.ACTIONS.SCRAPE
4444

45-
if (typeof params.info_hash === 'string') params.info_hash = [ params.info_hash ]
45+
if (typeof params.info_hash === 'string') params.info_hash = [params.info_hash]
4646
if (Array.isArray(params.info_hash)) {
4747
params.info_hash = params.info_hash.map(function (binaryInfoHash) {
4848
if (typeof binaryInfoHash !== 'string' || binaryInfoHash.length !== 20) {

lib/server/parse-websocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function parseWebSocketRequest (socket, opts, params) {
3939
} else if (params.action === 'scrape') {
4040
params.action = common.ACTIONS.SCRAPE
4141

42-
if (typeof params.info_hash === 'string') params.info_hash = [ params.info_hash ]
42+
if (typeof params.info_hash === 'string') params.info_hash = [params.info_hash]
4343
if (Array.isArray(params.info_hash)) {
4444
params.info_hash = params.info_hash.map(function (binaryInfoHash) {
4545
if (typeof binaryInfoHash !== 'string' || binaryInfoHash.length !== 20) {

test/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ function testClientAnnounceWithNumWant (t, serverType) {
357357
common.createServer(t, serverType, function (server, announceUrl) {
358358
var client1 = new Client({
359359
infoHash: fixtures.leaves.parsedTorrent.infoHash,
360-
announce: [ announceUrl ],
360+
announce: [announceUrl],
361361
peerId: peerId1,
362362
port: port,
363363
wrtc: {}

test/evict.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function serverTest (t, serverType, serverFamily) {
3131

3232
var client1 = new Client({
3333
infoHash: infoHash,
34-
announce: [ announceUrl ],
34+
announce: [announceUrl],
3535
peerId: peerId,
3636
port: 6881,
3737
wrtc: wrtc
@@ -43,7 +43,7 @@ function serverTest (t, serverType, serverFamily) {
4343
client1.once('update', function (data) {
4444
var client2 = new Client({
4545
infoHash: infoHash,
46-
announce: [ announceUrl ],
46+
announce: [announceUrl],
4747
peerId: peerId2,
4848
port: 6882,
4949
wrtc: wrtc
@@ -68,7 +68,7 @@ function serverTest (t, serverType, serverFamily) {
6868

6969
var client3 = new Client({
7070
infoHash: infoHash,
71-
announce: [ announceUrl ],
71+
announce: [announceUrl],
7272
peerId: peerId3,
7373
port: 6880,
7474
wrtc: wrtc

test/scrape.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function clientScrapeMulti (t, serverType) {
119119

120120
commonTest.createServer(t, serverType, function (server, announceUrl) {
121121
Client.scrape({
122-
infoHash: [ infoHash1, infoHash2 ],
122+
infoHash: [infoHash1, infoHash2],
123123
announce: announceUrl
124124
}, function (err, results) {
125125
t.error(err)
@@ -161,7 +161,7 @@ test('server: multiple info_hash scrape (manual http request)', function (t) {
161161
var scrapeUrl = announceUrl.replace('/announce', '/scrape')
162162

163163
var url = scrapeUrl + '?' + commonLib.querystringStringify({
164-
info_hash: [ binaryInfoHash1, binaryInfoHash2 ]
164+
info_hash: [binaryInfoHash1, binaryInfoHash2]
165165
})
166166

167167
get.concat(url, function (err, res, data) {

test/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function serverTest (t, serverType, serverFamily) {
3333

3434
var client1 = new Client({
3535
infoHash: infoHash,
36-
announce: [ announceUrl ],
36+
announce: [announceUrl],
3737
peerId: peerId,
3838
port: 6881,
3939
wrtc: wrtc
@@ -93,7 +93,7 @@ function serverTest (t, serverType, serverFamily) {
9393

9494
var client2 = new Client({
9595
infoHash: infoHash,
96-
announce: [ announceUrl ],
96+
announce: [announceUrl],
9797
peerId: peerId2,
9898
port: 6882,
9999
wrtc: wrtc
@@ -113,7 +113,7 @@ function serverTest (t, serverType, serverFamily) {
113113

114114
var client3 = new Client({
115115
infoHash: infoHash,
116-
announce: [ announceUrl ],
116+
announce: [announceUrl],
117117
peerId: peerId3,
118118
port: 6880,
119119
wrtc: wrtc

0 commit comments

Comments
 (0)