@@ -90,11 +90,11 @@ const errors = {
9090 162 : 'Wildcard Subscriptions not supported'
9191}
9292
93- function defaultId ( ) {
93+ function defaultId ( ) {
9494 return 'mqttjs_' + Math . random ( ) . toString ( 16 ) . substr ( 2 , 8 )
9595}
9696
97- function applyTopicAlias ( client , packet ) {
97+ function applyTopicAlias ( client , packet ) {
9898 if ( client . options . protocolVersion === 5 ) {
9999 if ( packet . cmd === 'publish' ) {
100100 let alias
@@ -144,7 +144,7 @@ function applyTopicAlias(client, packet) {
144144 }
145145}
146146
147- function removeTopicAliasAndRecoverTopicName ( client , packet ) {
147+ function removeTopicAliasAndRecoverTopicName ( client , packet ) {
148148 let alias
149149 if ( packet . properties ) {
150150 alias = packet . properties . topicAlias
@@ -169,7 +169,7 @@ function removeTopicAliasAndRecoverTopicName(client, packet) {
169169 }
170170}
171171
172- function sendPacket ( client , packet , cb ) {
172+ function sendPacket ( client , packet , cb ) {
173173 debug ( 'sendPacket :: packet: %O' , packet )
174174 debug ( 'sendPacket :: emitting `packetsend`' )
175175
@@ -187,7 +187,7 @@ function sendPacket(client, packet, cb) {
187187 }
188188}
189189
190- function flush ( queue ) {
190+ function flush ( queue ) {
191191 if ( queue ) {
192192 debug ( 'flush: queue exists? %b' , ! ! ( queue ) )
193193 Object . keys ( queue ) . forEach ( function ( messageId ) {
@@ -201,7 +201,7 @@ function flush(queue) {
201201 }
202202}
203203
204- function flushVolatile ( queue ) {
204+ function flushVolatile ( queue ) {
205205 if ( queue ) {
206206 debug ( 'flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function' )
207207 Object . keys ( queue ) . forEach ( function ( messageId ) {
@@ -213,7 +213,7 @@ function flushVolatile(queue) {
213213 }
214214}
215215
216- function storeAndSend ( client , packet , cb , cbStorePut ) {
216+ function storeAndSend ( client , packet , cb , cbStorePut ) {
217217 debug ( 'storeAndSend :: store packet with cmd %s to outgoingStore' , packet . cmd )
218218 let storePacket = packet
219219 let err
@@ -227,7 +227,7 @@ function storeAndSend(client, packet, cb, cbStorePut) {
227227 return cb && cb ( err )
228228 }
229229 }
230- client . outgoingStore . put ( storePacket , function storedPacket ( err ) {
230+ client . outgoingStore . put ( storePacket , function storedPacket ( err ) {
231231 if ( err ) {
232232 return cb && cb ( err )
233233 }
@@ -236,7 +236,7 @@ function storeAndSend(client, packet, cb, cbStorePut) {
236236 } )
237237}
238238
239- function nop ( error ) {
239+ function nop ( error ) {
240240 debug ( 'nop ::' , error )
241241}
242242
@@ -247,7 +247,7 @@ function nop(error) {
247247 * @param {Object } [options] - connection options
248248 * (see Connection#connect)
249249 */
250- function MqttClient ( streamBuilder , options ) {
250+ function MqttClient ( streamBuilder , options ) {
251251 let k
252252 const that = this
253253
@@ -339,7 +339,7 @@ function MqttClient(streamBuilder, options) {
339339 this . on ( 'connect' , function ( ) {
340340 const queue = that . queue
341341
342- function deliver ( ) {
342+ function deliver ( ) {
343343 const entry = queue . shift ( )
344344 debug ( 'deliver :: entry %o' , entry )
345345 let packet = null
@@ -427,7 +427,7 @@ MqttClient.prototype._setupStream = function () {
427427 packets . push ( packet )
428428 } )
429429
430- function nextTickWork ( ) {
430+ function nextTickWork ( ) {
431431 if ( packets . length ) {
432432 nextTick ( work )
433433 } else {
@@ -437,7 +437,7 @@ MqttClient.prototype._setupStream = function () {
437437 }
438438 }
439439
440- function work ( ) {
440+ function work ( ) {
441441 debug ( 'work :: getting next packet in queue' )
442442 const packet = packets . shift ( )
443443
@@ -460,7 +460,7 @@ MqttClient.prototype._setupStream = function () {
460460 work ( )
461461 }
462462
463- function streamErrorHandler ( error ) {
463+ function streamErrorHandler ( error ) {
464464 debug ( 'streamErrorHandler :: error' , error . message )
465465 if ( socketErrors . includes ( error . code ) ) {
466466 // handle error
@@ -989,7 +989,7 @@ MqttClient.prototype.end = function (force, opts, cb) {
989989 debug ( 'end :: cb? %s' , ! ! cb )
990990 cb = cb || nop
991991
992- function closeStores ( ) {
992+ function closeStores ( ) {
993993 debug ( 'end :: closeStores: closing incoming and outgoing stores' )
994994 that . disconnected = true
995995 that . incomingStore . close ( function ( e1 ) {
@@ -1008,7 +1008,7 @@ MqttClient.prototype.end = function (force, opts, cb) {
10081008 }
10091009 }
10101010
1011- function finish ( ) {
1011+ function finish ( ) {
10121012 // defer closesStores of an I/O cycle,
10131013 // just to make sure things are
10141014 // ok for websockets
@@ -1797,10 +1797,10 @@ MqttClient.prototype._onConnect = function (packet) {
17971797
17981798 this . connected = true
17991799
1800- function startStreamProcess ( ) {
1800+ function startStreamProcess ( ) {
18011801 let outStore = that . outgoingStore . createStream ( )
18021802
1803- function clearStoreProcessing ( ) {
1803+ function clearStoreProcessing ( ) {
18041804 that . _storeProcessing = false
18051805 that . _packetIdsDuringStoreProcessing = { }
18061806 }
@@ -1813,14 +1813,14 @@ MqttClient.prototype._onConnect = function (packet) {
18131813 that . emit ( 'error' , err )
18141814 } )
18151815
1816- function remove ( ) {
1816+ function remove ( ) {
18171817 outStore . destroy ( )
18181818 outStore = null
18191819 that . _flushStoreProcessingQueue ( )
18201820 clearStoreProcessing ( )
18211821 }
18221822
1823- function storeDeliver ( ) {
1823+ function storeDeliver ( ) {
18241824 // edge case, we wrapped this twice
18251825 if ( ! outStore ) {
18261826 return
0 commit comments