diff options
author | Jimmy Wärting <jimmy@warting.se> | 2018-08-29 14:22:31 +0300 |
---|---|---|
committer | Jimmy Wärting <jimmy@warting.se> | 2018-08-29 14:22:31 +0300 |
commit | 87930170c178bafef993af33a628b7a3861941fe (patch) | |
tree | eee5388148a51ef512252ed1109433af3c2a0748 /lib | |
parent | 7b53faa23d4bb6d4ae0581ff7cb505c08c3809a0 (diff) |
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 5f86228..73f4a61 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') @@ -271,7 +269,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) @@ -282,7 +280,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, @@ -290,11 +288,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 } |