From ac5cacba339a94a900367155d5d0317c29f30cf8 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 28 Jun 2018 12:29:00 +0100 Subject: [PATCH] fix: do not mutate the config object License: MIT Signed-off-by: Alan Shaw --- src/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index f308a3ecc3..4a39e285ab 100644 --- a/src/index.js +++ b/src/index.js @@ -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 }