Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2019-07-06 00:37:45 +0300
committerFeross Aboukhadijeh <feross@feross.org>2019-07-06 00:37:45 +0300
commit733e571a436951a8178d293cfa7315ad6bccf6b5 (patch)
tree67ab51ccacce61a69da4378a0063edd58535babe /lib
parent7d747efeca17a20298c51e2f393e38622c4053cd (diff)
standard
Diffstat (limited to 'lib')
-rw-r--r--lib/rarity-map.js2
-rw-r--r--lib/torrent.js8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/rarity-map.js b/lib/rarity-map.js
index 7630734..af712cc 100644
--- a/lib/rarity-map.js
+++ b/lib/rarity-map.js
@@ -45,7 +45,7 @@ class RarityMap {
if (availability === min) {
candidates.push(i)
} else if (availability < min) {
- candidates = [ i ]
+ candidates = [i]
min = availability
}
}
diff --git a/lib/torrent.js b/lib/torrent.js
index 39a725f..c81d33b 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -46,7 +46,7 @@ const RECHOKE_OPTIMISTIC_DURATION = 2 // 30 seconds
// IndexedDB chunk stores used in the browser benefit from maximum concurrency
const FILESYSTEM_CONCURRENCY = process.browser ? Infinity : 2
-const RECONNECT_WAIT = [ 1000, 5000, 15000 ]
+const RECONNECT_WAIT = [1000, 5000, 15000]
const VERSION = require('../package.json').version
const USER_AGENT = `WebTorrent/${VERSION} (https://webtorrent.io)`
@@ -169,7 +169,7 @@ class Torrent extends EventEmitter {
if (typeof window === 'undefined') throw new Error('browser-only property')
if (!this.torrentFile) return null
return URL.createObjectURL(
- new Blob([ this.torrentFile ], { type: 'application/x-bittorrent' })
+ new Blob([this.torrentFile], { type: 'application/x-bittorrent' })
)
}
@@ -348,7 +348,7 @@ class Torrent extends EventEmitter {
// to allow function hoisting
const self = this
- const urls = Array.isArray(this.xs) ? this.xs : [ this.xs ]
+ const urls = Array.isArray(this.xs) ? this.xs : [this.xs]
const tasks = urls.map(url => cb => {
getMetadataFromURL(url, cb)
@@ -1564,7 +1564,7 @@ class Torrent extends EventEmitter {
if (this.destroyed) throw new Error('torrent is destroyed')
if (!this.ready) return this.once('ready', () => { this.load(streams, cb) })
- if (!Array.isArray(streams)) streams = [ streams ]
+ if (!Array.isArray(streams)) streams = [streams]
if (!cb) cb = noop
const readable = new MultiStream(streams)