From 733e571a436951a8178d293cfa7315ad6bccf6b5 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 5 Jul 2019 14:37:45 -0700 Subject: standard --- lib/rarity-map.js | 2 +- lib/torrent.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3