mqtt 5.5.3 → 5.5.4
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/connect/index.js +3 -0
- package/build/lib/connect/index.js.map +1 -1
- package/build/lib/connect/tcp.js +2 -2
- package/build/lib/connect/tcp.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.esm.js +3 -3
- package/dist/mqtt.js +10 -7
- package/dist/mqtt.min.js +3 -3
- package/package.json +1 -1
- package/src/lib/connect/index.ts +5 -0
- package/src/lib/connect/tcp.ts +2 -2
package/package.json
CHANGED
package/src/lib/connect/index.ts
CHANGED
|
@@ -9,6 +9,11 @@ import MqttClient, {
|
|
|
9
9
|
import IS_BROWSER from '../is-browser'
|
|
10
10
|
import { StreamBuilder } from '../shared'
|
|
11
11
|
|
|
12
|
+
// Handling the process.nextTick is not a function error in react-native applications.
|
|
13
|
+
if (typeof process?.nextTick !== 'function') {
|
|
14
|
+
process.nextTick = setImmediate
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
const debug = _debug('mqttjs')
|
|
13
18
|
|
|
14
19
|
const protocols: Record<string, StreamBuilder> = {}
|
package/src/lib/connect/tcp.ts
CHANGED
|
@@ -13,11 +13,11 @@ const buildStream: StreamBuilder = (client, opts) => {
|
|
|
13
13
|
opts.port = opts.port || 1883
|
|
14
14
|
opts.hostname = opts.hostname || opts.host || 'localhost'
|
|
15
15
|
|
|
16
|
-
const { port } = opts
|
|
16
|
+
const { port, path } = opts
|
|
17
17
|
const host = opts.hostname
|
|
18
18
|
|
|
19
19
|
debug('port %d and host %s', port, host)
|
|
20
|
-
return net.createConnection(port, host)
|
|
20
|
+
return net.createConnection({ port, host, path })
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default buildStream
|