@@ -3,7 +3,6 @@ module.exports = Client
33var Buffer = require ( 'safe-buffer' ) . Buffer
44var debug = require ( 'debug' ) ( 'bittorrent-tracker:client' )
55var EventEmitter = require ( 'events' ) . EventEmitter
6- var extend = require ( 'xtend' )
76var inherits = require ( 'inherits' )
87var once = require ( 'once' )
98var parallel = require ( 'run-parallel' )
@@ -130,7 +129,7 @@ Client.scrape = function (opts, cb) {
130129 if ( ! opts . infoHash ) throw new Error ( 'Option `infoHash` is required' )
131130 if ( ! opts . announce ) throw new Error ( 'Option `announce` is required' )
132131
133- var clientOpts = extend ( opts , {
132+ var clientOpts = Object . assign ( { } , opts , {
134133 infoHash : Array . isArray ( opts . infoHash ) ? opts . infoHash [ 0 ] : opts . infoHash ,
135134 peerId : Buffer . from ( '01234567890123456789' ) , // dummy value
136135 port : 6881 // dummy value
@@ -291,6 +290,6 @@ Client.prototype._defaultAnnounceOpts = function (opts) {
291290 if ( opts . uploaded == null ) opts . uploaded = 0
292291 if ( opts . downloaded == null ) opts . downloaded = 0
293292
294- if ( self . _getAnnounceOpts ) opts = extend ( opts , self . _getAnnounceOpts ( ) )
293+ if ( self . _getAnnounceOpts ) opts = Object . assign ( { } , opts , self . _getAnnounceOpts ( ) )
295294 return opts
296295}
0 commit comments