From e0daf1ca9a8d60ec183894c71a995d8bae8927cc Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 2 Jan 2023 08:47:46 +0100 Subject: [PATCH] refactor: use nullish coalescing for confirmable option --- coap/coap-request.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/coap/coap-request.js b/coap/coap-request.js index 7d71e3a..edfb380 100644 --- a/coap/coap-request.js +++ b/coap/coap-request.js @@ -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) {