mqtt 5.7.2 → 5.8.0
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/README.md +8 -1
- package/build/lib/KeepaliveManager.d.ts +2 -1
- package/build/lib/KeepaliveManager.js +6 -1
- package/build/lib/KeepaliveManager.js.map +1 -1
- package/build/lib/client.d.ts +2 -1
- package/build/lib/client.js.map +1 -1
- package/build/lib/connect/index.js +3 -2
- package/build/lib/connect/index.js.map +1 -1
- package/build/lib/is-browser.js +5 -1
- package/build/lib/is-browser.js.map +1 -1
- package/build/mqtt.d.ts +1 -0
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.esm.js +5 -5
- package/dist/mqtt.js +6 -5
- package/dist/mqtt.min.js +5 -5
- package/package.json +1 -1
- package/src/lib/KeepaliveManager.ts +7 -2
- package/src/lib/client.ts +3 -1
- package/src/lib/connect/index.ts +4 -1
- package/src/lib/is-browser.ts +7 -1
- package/src/mqtt.ts +1 -0
package/dist/mqtt.js
CHANGED
|
@@ -12634,7 +12634,7 @@ var mqtt = (() => {
|
|
|
12634
12634
|
// package-json:../../package.json
|
|
12635
12635
|
var require_package = __commonJS({
|
|
12636
12636
|
"package-json:../../package.json"(exports5, module) {
|
|
12637
|
-
module.exports = { version: "5.
|
|
12637
|
+
module.exports = { version: "5.8.0" };
|
|
12638
12638
|
}
|
|
12639
12639
|
});
|
|
12640
12640
|
|
|
@@ -17282,12 +17282,13 @@ var mqtt = (() => {
|
|
|
17282
17282
|
}
|
|
17283
17283
|
return false;
|
|
17284
17284
|
};
|
|
17285
|
+
var isTxikijsEnv = () => typeof navigator !== "undefined" && navigator.userAgent === "txiki.js";
|
|
17285
17286
|
var isWebWorkerEnv = () => {
|
|
17286
17287
|
var _a, _b;
|
|
17287
17288
|
return Boolean(typeof self === "object" && ((_b = (_a = self === null || self === void 0 ? void 0 : self.constructor) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.includes("WorkerGlobalScope")));
|
|
17288
17289
|
};
|
|
17289
17290
|
var isReactNativeEnv = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
17290
|
-
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv();
|
|
17291
|
+
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv() || isTxikijsEnv();
|
|
17291
17292
|
exports5.isWebWorker = isWebWorkerEnv();
|
|
17292
17293
|
exports5.isReactNativeBrowser = isReactNativeEnv();
|
|
17293
17294
|
exports5.default = isBrowser;
|
|
@@ -17657,7 +17658,7 @@ var mqtt = (() => {
|
|
|
17657
17658
|
constructor(client, variant) {
|
|
17658
17659
|
this.destroyed = false;
|
|
17659
17660
|
this.client = client;
|
|
17660
|
-
this.timer = (0, get_timer_1.default)(variant);
|
|
17661
|
+
this.timer = typeof variant === "object" && "set" in variant && "clear" in variant ? variant : (0, get_timer_1.default)(variant);
|
|
17661
17662
|
this.setKeepalive(client.options.keepalive);
|
|
17662
17663
|
}
|
|
17663
17664
|
clear() {
|
|
@@ -21398,7 +21399,7 @@ var mqtt = (() => {
|
|
|
21398
21399
|
}
|
|
21399
21400
|
}
|
|
21400
21401
|
function connect(brokerUrl, opts) {
|
|
21401
|
-
var _a, _b, _c;
|
|
21402
|
+
var _a, _b, _c, _d;
|
|
21402
21403
|
debug("connecting to an MQTT broker...");
|
|
21403
21404
|
if (typeof brokerUrl === "object" && !opts) {
|
|
21404
21405
|
opts = brokerUrl;
|
|
@@ -21425,7 +21426,7 @@ var mqtt = (() => {
|
|
|
21425
21426
|
opts.unixSocket = opts.unixSocket || ((_b = opts.protocol) === null || _b === void 0 ? void 0 : _b.includes("+unix"));
|
|
21426
21427
|
if (opts.unixSocket) {
|
|
21427
21428
|
opts.protocol = opts.protocol.replace("+unix", "");
|
|
21428
|
-
} else if (!((_c = opts.protocol) === null || _c === void 0 ? void 0 : _c.startsWith("ws"))) {
|
|
21429
|
+
} else if (!((_c = opts.protocol) === null || _c === void 0 ? void 0 : _c.startsWith("ws")) && !((_d = opts.protocol) === null || _d === void 0 ? void 0 : _d.startsWith("wx"))) {
|
|
21429
21430
|
delete opts.path;
|
|
21430
21431
|
}
|
|
21431
21432
|
parseAuthOptions(opts);
|