fix: do not mutate the config object

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
This commit is contained in:
Alan Shaw 2018-06-28 12:29:00 +01:00 committed by Jacob Heun
parent e320854db7
commit ac5cacba33

View File

@ -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
}