From aac24db5a61fd2e53465be2919c8b60c6e4402d8 Mon Sep 17 00:00:00 2001 From: Nadav Ivgi Date: Sat, 21 Nov 2020 03:30:41 +0200 Subject: [PATCH] nodejs-bwt-daemon: Delete nully options so that they get their default value --- contrib/nodejs-bwt-daemon/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/nodejs-bwt-daemon/index.js b/contrib/nodejs-bwt-daemon/index.js index 6b8d7bb..43ca509 100644 --- a/contrib/nodejs-bwt-daemon/index.js +++ b/contrib/nodejs-bwt-daemon/index.js @@ -54,6 +54,11 @@ function init(options) { delete options.http } + // Delete nully options so that they get their default value + Object.entries(options) + .filter(([ _, val ]) => val == null) + .forEach(([ key, _ ]) => delete options[key]) + if (!options.electrum_addr && !options.http_addr) { throw new Error('None of the bwt services are enabled') }