@crisp-e3/sdk 0.5.4 → 0.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/index.js CHANGED
@@ -206,7 +206,10 @@ var getAddressFromSignature = async (signature, messageHash) => {
206
206
  return publicKeyToAddress(publicKey);
207
207
  };
208
208
  async function getOptimalThreadCount() {
209
- if (typeof process !== "undefined" && process.versions?.node) {
209
+ if (typeof navigator !== "undefined" && navigator.hardwareConcurrency) {
210
+ return Math.max(1, navigator.hardwareConcurrency - 1);
211
+ }
212
+ if (typeof window === "undefined" && typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined") {
210
213
  try {
211
214
  const os = await import("os");
212
215
  const cpuCount = typeof os.availableParallelism === "function" ? os.availableParallelism() : os.cpus().length;
@@ -214,9 +217,6 @@ async function getOptimalThreadCount() {
214
217
  } catch {
215
218
  }
216
219
  }
217
- if (typeof navigator !== "undefined" && navigator.hardwareConcurrency) {
218
- return Math.max(1, navigator.hardwareConcurrency - 1);
219
- }
220
220
  return 5;
221
221
  }
222
222