@calimero-network/mero-js 25.0.5 → 25.0.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.cjs CHANGED
@@ -10475,14 +10475,15 @@ async function resolveRelayFromInvitation(input) {
10475
10475
  const addressable = candidates.filter(
10476
10476
  (n) => typeof n.relayUrl === "string" && n.relayUrl.length > 0
10477
10477
  );
10478
- if (addressable.length === 0) {
10478
+ const [firstAddressable] = addressable;
10479
+ if (firstAddressable === void 0) {
10479
10480
  return {
10480
10481
  ok: false,
10481
10482
  step: "no-relay-url",
10482
10483
  reason: "A node your invitation names can admit you, but the cloud knows no address for it yet, so there would be nothing to connect through afterwards. Try again shortly."
10483
10484
  };
10484
10485
  }
10485
- const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ?? addressable[0];
10486
+ const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ?? firstAddressable;
10486
10487
  return {
10487
10488
  ok: true,
10488
10489
  relayUrl: chosen.relayUrl,
@@ -10847,7 +10848,10 @@ function newer(a, b) {
10847
10848
  return false;
10848
10849
  }
10849
10850
  function selectLatestBundle(bundles) {
10850
- return bundles.filter((b) => !b.yanked && typeof b.appVersion === "string" && b.appVersion.length > 0).reduce((best, b) => !best || newer(b.appVersion, best.appVersion) ? b : best, void 0);
10851
+ return bundles.filter((b) => !b.yanked && typeof b.appVersion === "string" && b.appVersion.length > 0).reduce(
10852
+ (best, b) => !best || newer(b.appVersion, best.appVersion) ? b : best,
10853
+ void 0
10854
+ );
10851
10855
  }
10852
10856
  async function fetchRegistryBundles(registryUrl, pkg, fetchFn = globalThis.fetch) {
10853
10857
  const url = `${registryUrl.replace(/\/+$/, "")}/api/v2/bundles?package=${encodeURIComponent(pkg)}`;