Skip to content

Commit

Permalink
Merge pull request #79 from JKRhb/confirmable-coalescing
Browse files Browse the repository at this point in the history
refactor: use nullish coalescing for confirmable option
  • Loading branch information
JKRhb authored Jan 2, 2023
2 parents 15401df + e0daf1c commit ca50eb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"reporter": "spec"
},
"jshintConfig": {
"esversion": 6,
"esversion": 11,
"curly": true,
"forin": true,
"immed": true,
Expand Down

0 comments on commit ca50eb7

Please sign in to comment.