mqtt 5.5.0 → 5.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/BufferedDuplex.js +4 -3
- package/build/lib/BufferedDuplex.js.map +1 -1
- package/build/lib/get-timer.js +3 -1
- package/build/lib/get-timer.js.map +1 -1
- package/build/lib/is-browser.d.ts +1 -0
- package/build/lib/is-browser.js +2 -1
- package/build/lib/is-browser.js.map +1 -1
- package/build/lib/shared.js +1 -1
- package/build/lib/shared.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.esm.js +5 -5
- package/dist/mqtt.js +9 -7
- package/dist/mqtt.min.js +5 -5
- package/package.json +1 -1
- package/src/lib/BufferedDuplex.ts +3 -1
- package/src/lib/get-timer.ts +4 -2
- package/src/lib/is-browser.ts +2 -0
- package/src/lib/shared.ts +6 -5
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Duplex, Transform } from 'readable-stream'
|
|
2
|
+
import { Buffer } from 'buffer'
|
|
2
3
|
import { IClientOptions } from './client'
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -79,7 +80,8 @@ export class BufferedDuplex extends Duplex {
|
|
|
79
80
|
|
|
80
81
|
_destroy(err: Error, callback: (error: Error) => void): void {
|
|
81
82
|
this.writeQueue = []
|
|
82
|
-
|
|
83
|
+
// do not pass error here otherwise we should listen for `error` event on proxy to prevent uncaught exception
|
|
84
|
+
this.proxy.destroy()
|
|
83
85
|
callback(err)
|
|
84
86
|
}
|
|
85
87
|
|
package/src/lib/get-timer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import isBrowser, { isWebWorker } from './is-browser'
|
|
1
|
+
import isBrowser, { isWebWorker, isReactNativeBrowser } from './is-browser'
|
|
2
2
|
import { clearTimeout as clearT, setTimeout as setT } from 'worker-timers'
|
|
3
3
|
import type { TimerVariant } from './shared'
|
|
4
4
|
|
|
@@ -30,7 +30,9 @@ const getTimer = (variant: TimerVariant): Timer => {
|
|
|
30
30
|
}
|
|
31
31
|
case 'auto':
|
|
32
32
|
default: {
|
|
33
|
-
return isBrowser && !isWebWorker
|
|
33
|
+
return isBrowser && !isWebWorker && !isReactNativeBrowser
|
|
34
|
+
? workerTimer
|
|
35
|
+
: nativeTimer
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
}
|
package/src/lib/is-browser.ts
CHANGED
package/src/lib/shared.ts
CHANGED
|
@@ -76,8 +76,9 @@ export function applyMixin(
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
export const nextTick =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
export const nextTick =
|
|
80
|
+
typeof process?.nextTick === 'function'
|
|
81
|
+
? process.nextTick
|
|
82
|
+
: (callback: () => void) => {
|
|
83
|
+
setTimeout(callback, 0)
|
|
84
|
+
}
|