Skip to content

Commit

Permalink
fix: do not mutate the config object
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw authored and Jacob Heun committed Jun 29, 2018
1 parent e320854 commit ac5cacb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ class Node extends EventEmitter {
let d

if (typeof D === 'function') {
config.peerInfo = this.peerInfo
d = new D(config)
d = new D(Object.assign({}, config, { peerInfo: this.peerInfo }))
} else {
d = D
}
Expand Down

0 comments on commit ac5cacb

Please sign in to comment.