diff options
author | Diego RodrÃguez Baquero <diegorbaquero@gmail.com> | 2018-08-29 20:13:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-29 20:13:18 +0300 |
commit | b14d36fe80192e600ed6ab8372c27d061762d6ad (patch) | |
tree | c0e65f6fca06609d30785de3528cc4d2a81a68d4 /lib | |
parent | 06379b5171060716c5b83062e5caa59b6fe1969b (diff) | |
parent | 87930170c178bafef993af33a628b7a3861941fe (diff) |
Merge pull request #1491 from jimmywarting/feature/remove_xtend
bye bye xtend
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 610b280..0213f3b 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -6,8 +6,6 @@ const ChunkStoreWriteStream = require('chunk-store-stream/write') const debug = require('debug')('webtorrent:torrent') const Discovery = require('torrent-discovery') const EventEmitter = require('events').EventEmitter -const extend = require('xtend') -const extendMutable = require('xtend/mutable') const fs = require('fs') const FSChunkStore = require('fs-chunk-store') // browser: `memory-chunk-store` const get = require('simple-get') @@ -272,7 +270,7 @@ class Torrent extends EventEmitter { uniq(parsedTorrent.announce) uniq(parsedTorrent.urlList) - extendMutable(this, parsedTorrent) + Object.assign(this, parsedTorrent) this.magnetURI = parseTorrent.toMagnetURI(parsedTorrent) this.torrentFile = parseTorrent.toTorrentFile(parsedTorrent) @@ -283,7 +281,7 @@ class Torrent extends EventEmitter { let trackerOpts = this.client.tracker if (trackerOpts) { - trackerOpts = extend(this.client.tracker, { + trackerOpts = Object.assign({}, this.client.tracker, { getAnnounceOpts: () => { const opts = { uploaded: this.uploaded, @@ -291,11 +289,11 @@ class Torrent extends EventEmitter { left: Math.max(this.length - this.downloaded, 0) } if (this.client.tracker.getAnnounceOpts) { - extendMutable(opts, this.client.tracker.getAnnounceOpts()) + Object.assign(opts, this.client.tracker.getAnnounceOpts()) } if (this._getAnnounceOpts) { // TODO: consider deprecating this, as it's redundant with the former case - extendMutable(opts, this._getAnnounceOpts()) + Object.assign(opts, this._getAnnounceOpts()) } return opts } |