@nhtio/swarm 1.20250425.0 → 1.20251110.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/index.mjs CHANGED
@@ -11,7 +11,7 @@ var Ja = (e, t, v) => su(iu(e), v, t);
11
11
  import { t as gu } from "./types-CBFnAS2P.mjs";
12
12
  import { M as MissingEncryptionKey, A as AlreadyInitializedInContextError, U as UnsupportedEnvironmentError, R as RequestTimeoutError } from "./errors-Cqo3rABf.mjs";
13
13
  import { e as vu } from "./errors-Cqo3rABf.mjs";
14
- const isTabEnvironment = () => typeof window < "u" && typeof window.navigator < "u" && typeof window.navigator.userAgent < "u", isWorkerEnvironment = () => typeof ServiceWorkerGlobalScope < "u" && self instanceof ServiceWorkerGlobalScope, isSsrEnvironment = () => typeof process < "u" && typeof process.versions < "u" && !!process.versions.node, isSafari = () => typeof window < "u" && typeof window.navigator < "u" && window.navigator.userAgent.includes("Safari") && !window.navigator.userAgent.includes("Chrome");
14
+ const isTabEnvironment = () => typeof window < "u" && typeof window.navigator < "u" && typeof window.navigator.userAgent < "u", isWorkerEnvironment = () => typeof ServiceWorkerGlobalScope < "u" && self instanceof ServiceWorkerGlobalScope, isWebWorkerEnvironment = () => typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, isSsrEnvironment = () => typeof process < "u" && typeof process.versions < "u" && !!process.versions.node, isSafari = () => typeof window < "u" && typeof window.navigator < "u" && window.navigator.userAgent.includes("Safari") && !window.navigator.userAgent.includes("Chrome");
15
15
  function isGlobalObject(e) {
16
16
  return typeof e == "object" && e !== null && "Math" in e;
17
17
  }
@@ -27863,7 +27863,7 @@ const ra = class ra extends TypedEventEmitter {
27863
27863
  const w = getGlobal(), T = getEncryption(v);
27864
27864
  if (typeof w[FOR_SWARM] < "u" && w[FOR_SWARM] instanceof ra)
27865
27865
  throw new AlreadyInitializedInContextError();
27866
- if (typeof navigator > "u" || !("serviceWorker" in navigator))
27866
+ if (isSsrEnvironment() || !isTabEnvironment() && !isWorkerEnvironment() && !isWebWorkerEnvironment())
27867
27867
  throw new UnsupportedEnvironmentError();
27868
27868
  super();
27869
27869
  Xo(this, Co);
@@ -28171,7 +28171,7 @@ Oa = new WeakMap(), na = new WeakMap(), Ba = new WeakMap(), fa = new WeakMap(),
28171
28171
  }, 100));
28172
28172
  }, Ta(ra, "INTERNAL_HEARTBEAT", "__swarm_heartbeat"), Ta(ra, "INTERNAL_OBITUARY", "__swarm_obituary");
28173
28173
  let Swarm = ra;
28174
- const version = "1.20250425.0";
28174
+ const version = "1.20251110.0";
28175
28175
  export {
28176
28176
  Secret,
28177
28177
  Swarm,