@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.mjs CHANGED
@@ -10190,14 +10190,15 @@ async function resolveRelayFromInvitation(input) {
10190
10190
  const addressable = candidates.filter(
10191
10191
  (n) => typeof n.relayUrl === "string" && n.relayUrl.length > 0
10192
10192
  );
10193
- if (addressable.length === 0) {
10193
+ const [firstAddressable] = addressable;
10194
+ if (firstAddressable === void 0) {
10194
10195
  return {
10195
10196
  ok: false,
10196
10197
  step: "no-relay-url",
10197
10198
  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."
10198
10199
  };
10199
10200
  }
10200
- const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ?? addressable[0];
10201
+ const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ?? firstAddressable;
10201
10202
  return {
10202
10203
  ok: true,
10203
10204
  relayUrl: chosen.relayUrl,
@@ -10562,7 +10563,10 @@ function newer(a, b) {
10562
10563
  return false;
10563
10564
  }
10564
10565
  function selectLatestBundle(bundles) {
10565
- 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);
10566
+ return bundles.filter((b) => !b.yanked && typeof b.appVersion === "string" && b.appVersion.length > 0).reduce(
10567
+ (best, b) => !best || newer(b.appVersion, best.appVersion) ? b : best,
10568
+ void 0
10569
+ );
10566
10570
  }
10567
10571
  async function fetchRegistryBundles(registryUrl, pkg, fetchFn = globalThis.fetch) {
10568
10572
  const url = `${registryUrl.replace(/\/+$/, "")}/api/v2/bundles?package=${encodeURIComponent(pkg)}`;