@calimero-network/mero-js 19.27.0 → 19.27.1

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.cjs CHANGED
@@ -7441,17 +7441,14 @@ function audienceLabel(audience) {
7441
7441
  }
7442
7442
  async function login(config) {
7443
7443
  const baseUrl = config.nodeUrl.replace(/\/+$/, "");
7444
- const doFetch = config.fetch ?? globalThis.fetch;
7445
7444
  const timeoutMs = config.timeoutMs ?? 1e4;
7446
7445
  const request = async (path, init) => {
7447
7446
  const controller = new AbortController();
7448
7447
  const timer = setTimeout(() => controller.abort(), timeoutMs);
7449
7448
  let response;
7450
7449
  try {
7451
- response = await doFetch(`${baseUrl}${path}`, {
7452
- ...init,
7453
- signal: controller.signal
7454
- });
7450
+ const requestInit = { ...init, signal: controller.signal };
7451
+ response = config.fetch ? await config.fetch(`${baseUrl}${path}`, requestInit) : await globalThis.fetch(`${baseUrl}${path}`, requestInit);
7455
7452
  } catch (err) {
7456
7453
  throw new HTTPError(
7457
7454
  0,