Skip to content

Commit

Permalink
nodejs-bwt-daemon: Delete nully options so that they get their defaul…
Browse files Browse the repository at this point in the history
…t value
  • Loading branch information
shesek committed Nov 21, 2020
1 parent 1a62dad commit aac24db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrib/nodejs-bwt-daemon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down

0 comments on commit aac24db

Please sign in to comment.