@@ -638,11 +638,11 @@ MqttClient.prototype.publish = function (topic, message, opts, callback) {
638638 }
639639 const packet = {
640640 cmd : 'publish' ,
641- topic : topic ,
641+ topic,
642642 payload : message ,
643643 qos : opts . qos ,
644644 retain : opts . retain ,
645- messageId : messageId ,
645+ messageId,
646646 dup : opts . dup
647647 }
648648
@@ -675,7 +675,7 @@ MqttClient.prototype.publish = function (topic, message, opts, callback) {
675675 {
676676 invoke : publishProc ,
677677 cbStorePut : opts . cbStorePut ,
678- callback : callback
678+ callback
679679 }
680680 )
681681 }
@@ -750,7 +750,7 @@ MqttClient.prototype.subscribe = function () {
750750 that . _resubscribeTopics [ topic ] . qos < opts . qos ||
751751 resubscribe ) {
752752 const currentOpts = {
753- topic : topic ,
753+ topic,
754754 qos : opts . qos
755755 }
756756 if ( version === 5 ) {
@@ -805,7 +805,7 @@ MqttClient.prototype.subscribe = function () {
805805 qos : 1 ,
806806 retain : false ,
807807 dup : false ,
808- messageId : messageId
808+ messageId
809809 }
810810
811811 if ( opts . properties ) {
@@ -854,7 +854,7 @@ MqttClient.prototype.subscribe = function () {
854854 this . _storeProcessingQueue . push (
855855 {
856856 invoke : subscribeProc ,
857- callback : callback
857+ callback
858858 }
859859 )
860860 }
@@ -911,7 +911,7 @@ MqttClient.prototype.unsubscribe = function () {
911911 const packet = {
912912 cmd : 'unsubscribe' ,
913913 qos : 1 ,
914- messageId : messageId
914+ messageId
915915 }
916916
917917 if ( typeof topic === 'string' ) {
@@ -945,7 +945,7 @@ MqttClient.prototype.unsubscribe = function () {
945945 this . _storeProcessingQueue . push (
946946 {
947947 invoke : unsubscribeProc ,
948- callback : callback
948+ callback
949949 }
950950 )
951951 }
@@ -1054,7 +1054,7 @@ MqttClient.prototype.end = function (force, opts, cb) {
10541054MqttClient . prototype . removeOutgoingMessage = function ( messageId ) {
10551055 const cb = this . outgoing [ messageId ] ? this . outgoing [ messageId ] . cb : null
10561056 delete this . outgoing [ messageId ]
1057- this . outgoingStore . del ( { messageId : messageId } , function ( ) {
1057+ this . outgoingStore . del ( { messageId } , function ( ) {
10581058 cb ( new Error ( 'Message removed' ) )
10591059 } )
10601060 return this
@@ -1297,7 +1297,7 @@ MqttClient.prototype._storePacket = function (packet, cb, cbStorePut) {
12971297 }
12981298 // check that the packet is not a qos of 0, or that the command is not a publish
12991299 if ( ( ( storePacket . qos || 0 ) === 0 && this . queueQoSZero ) || storePacket . cmd !== 'publish' ) {
1300- this . queue . push ( { packet : storePacket , cb : cb } )
1300+ this . queue . push ( { packet : storePacket , cb } )
13011301 } else if ( storePacket . qos > 0 ) {
13021302 cb = this . outgoing [ storePacket . messageId ] ? this . outgoing [ storePacket . messageId ] . cb : null
13031303 this . outgoingStore . put ( storePacket , function ( err ) {
@@ -1533,10 +1533,10 @@ MqttClient.prototype._handlePublish = function (packet, done) {
15331533 if ( error ) { return that . emit ( 'error' , error ) }
15341534 if ( validReasonCodes . indexOf ( code ) === - 1 ) { return that . emit ( 'error' , new Error ( 'Wrong reason code for pubrec' ) ) }
15351535 if ( code ) {
1536- that . _sendPacket ( { cmd : 'pubrec' , messageId : messageId , reasonCode : code } , done )
1536+ that . _sendPacket ( { cmd : 'pubrec' , messageId, reasonCode : code } , done )
15371537 } else {
15381538 that . incomingStore . put ( packet , function ( ) {
1539- that . _sendPacket ( { cmd : 'pubrec' , messageId : messageId } , done )
1539+ that . _sendPacket ( { cmd : 'pubrec' , messageId } , done )
15401540 } )
15411541 }
15421542 } )
@@ -1556,7 +1556,7 @@ MqttClient.prototype._handlePublish = function (packet, done) {
15561556 if ( err ) {
15571557 return done && done ( err )
15581558 }
1559- that . _sendPacket ( { cmd : 'puback' , messageId : messageId , reasonCode : code } , done )
1559+ that . _sendPacket ( { cmd : 'puback' , messageId, reasonCode : code } , done )
15601560 } )
15611561 } )
15621562 break
@@ -1642,7 +1642,7 @@ MqttClient.prototype._handleAck = function (packet) {
16421642 response = {
16431643 cmd : 'pubrel' ,
16441644 qos : 2 ,
1645- messageId : messageId
1645+ messageId
16461646 }
16471647 const pubrecRC = packet . reasonCode
16481648
@@ -1703,7 +1703,7 @@ MqttClient.prototype._handlePubrel = function (packet, callback) {
17031703 const messageId = packet . messageId
17041704 const that = this
17051705
1706- const comp = { cmd : 'pubcomp' , messageId : messageId }
1706+ const comp = { cmd : 'pubcomp' , messageId }
17071707
17081708 that . incomingStore . get ( packet , function ( err , pub ) {
17091709 if ( ! err ) {
0 commit comments