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 committed Jun 28, 2018
1 parent 57b872c commit 953c850
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
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 953c850

Please sign in to comment.