mqtt 5.5.5 → 5.5.6

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/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.5.5" };
12637
+ module.exports = { version: "5.5.6" };
12638
12638
  }
12639
12639
  });
12640
12640
 
@@ -17192,7 +17192,7 @@ var mqtt = (() => {
17192
17192
  return client;
17193
17193
  }
17194
17194
  client.pingResp = Date.now();
17195
- if (packet.cmd !== "pingresp") {
17195
+ if (!["pingresp", "publish"].includes(packet.cmd)) {
17196
17196
  client["_shiftPingInterval"]();
17197
17197
  }
17198
17198
  client.log("_handlePacket :: emitting packetreceive");
@@ -17267,7 +17267,18 @@ var mqtt = (() => {
17267
17267
  init_navigator();
17268
17268
  Object.defineProperty(exports5, "__esModule", { value: true });
17269
17269
  exports5.isReactNativeBrowser = exports5.isWebWorker = void 0;
17270
- var isStandardBrowserEnv = () => typeof window !== "undefined" && typeof window.document !== "undefined";
17270
+ var isStandardBrowserEnv = () => {
17271
+ var _a;
17272
+ if (typeof window !== "undefined") {
17273
+ const electronRenderCheck = ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) === null || _a === void 0 ? void 0 : _a.toLowerCase().indexOf(" electron/")) > -1;
17274
+ if (electronRenderCheck && (process_exports === null || process_exports === void 0 ? void 0 : process_exports.versions)) {
17275
+ const electronMainCheck = Object.prototype.hasOwnProperty.call(process_exports.versions, "electron");
17276
+ return !electronMainCheck;
17277
+ }
17278
+ return typeof window.document !== "undefined";
17279
+ }
17280
+ return false;
17281
+ };
17271
17282
  var isWebWorkerEnv = () => {
17272
17283
  var _a, _b;
17273
17284
  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")));
@@ -21147,9 +21158,6 @@ var mqtt = (() => {
21147
21158
  }
21148
21159
  function setDefaultOpts(opts) {
21149
21160
  const options = opts;
21150
- if (!opts.hostname) {
21151
- options.hostname = "localhost";
21152
- }
21153
21161
  if (!opts.port) {
21154
21162
  if (opts.protocol === "wss") {
21155
21163
  options.port = 443;
@@ -21220,6 +21228,7 @@ var mqtt = (() => {
21220
21228
  var streamBuilder = (client, opts) => {
21221
21229
  debug("streamBuilder");
21222
21230
  const options = setDefaultOpts(opts);
21231
+ options.hostname = options.hostname || options.host || "localhost";
21223
21232
  const url = buildUrl(options, client);
21224
21233
  const socket = createWebSocket(client, url, options);
21225
21234
  const webSocketStream = ws_1.default.createWebSocketStream(socket, options.wsOptions);