Skip to content

Commit

Permalink
refactor: use nullish coalescing for confirmable option
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 2, 2023
1 parent 6f781a7 commit e0daf1c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions coap/coap-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,7 @@ module.exports = function (RED) {
reqOpts.headers["Content-Format"] = config["content-format"];
reqOpts.multicast = config.multicast;
reqOpts.multicastTimeout = config.multicastTimeout;
reqOpts.confirmable = msg.confirmable;

if (reqOpts.confirmable == null) {

reqOpts.confirmable = config.confirmable;
}
reqOpts.confirmable = msg.confirmable ?? config.confirmable ?? true;

function _onResponse(res) {
function _send(payload) {
Expand Down

0 comments on commit e0daf1c

Please sign in to comment.