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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mqtt",
3
3
  "description": "A library for the MQTT protocol",
4
- "version": "5.5.3",
4
+ "version": "5.5.4",
5
5
  "contributors": [
6
6
  "Adam Rudd <adamvrr@gmail.com>",
7
7
  "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
@@ -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> = {}
@@ -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