@leofcoin/peernet 1.1.93 → 1.1.94

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.
@@ -1,4 +1,4 @@
1
- import { L as LittlePubSub } from './peernet-EWyOZqOu.js';
1
+ import { L as LittlePubSub } from './peernet-CG0sdKM4.js';
2
2
  import './identity-Cn0iQbY3.js';
3
3
  import './value-C3vAp-wb.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './peernet-EWyOZqOu.js';
1
+ import { F as FormatInterface } from './peernet-CG0sdKM4.js';
2
2
  import './identity-Cn0iQbY3.js';
3
3
  import './value-C3vAp-wb.js';
4
4
 
@@ -8372,7 +8372,7 @@ class Peernet {
8372
8372
  this.root = options.root;
8373
8373
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
8374
8374
  // FolderMessageResponse
8375
- } = await import(/* webpackChunkName: "messages" */ './messages-B9TrXtD1.js');
8375
+ } = await import(/* webpackChunkName: "messages" */ './messages-CaxCm2Mx.js');
8376
8376
  /**
8377
8377
  * proto Object containing protos
8378
8378
  * @type {Object}
@@ -8466,7 +8466,7 @@ class Peernet {
8466
8466
  if (this.#starting || this.#started)
8467
8467
  return;
8468
8468
  this.#starting = true;
8469
- const importee = await import('./client-BScgNzXE.js');
8469
+ const importee = await import('./client-BmW52yUu.js');
8470
8470
  /**
8471
8471
  * @access public
8472
8472
  * @type {PeernetClient}
@@ -8622,6 +8622,7 @@ class Peernet {
8622
8622
  }
8623
8623
  catch (error) {
8624
8624
  console.error(`Error while walking ${peerId}`, error);
8625
+ return undefined;
8625
8626
  }
8626
8627
  };
8627
8628
  let walks = [];
@@ -8630,7 +8631,7 @@ class Peernet {
8630
8631
  walks.push(walk(peer, peerId));
8631
8632
  }
8632
8633
  }
8633
- return Promise.all(walks);
8634
+ return Promise.race(walks);
8634
8635
  }
8635
8636
  /**
8636
8637
  * Override DHT behavior, try's finding the content three times
@@ -121,7 +121,7 @@ export default class Peernet {
121
121
  *
122
122
  * @param {String} hash
123
123
  */
124
- walk(hash: any): Promise<any[]>;
124
+ walk(hash: any): Promise<any>;
125
125
  /**
126
126
  * Override DHT behavior, try's finding the content three times
127
127
  *
@@ -1,3 +1,3 @@
1
- export { P as default } from './peernet-EWyOZqOu.js';
1
+ export { P as default } from './peernet-CG0sdKM4.js';
2
2
  import './identity-Cn0iQbY3.js';
3
3
  import './value-C3vAp-wb.js';
@@ -703,6 +703,7 @@ class Peernet {
703
703
  }
704
704
  catch (error) {
705
705
  console.error(`Error while walking ${peerId}`, error);
706
+ return undefined;
706
707
  }
707
708
  };
708
709
  let walks = [];
@@ -711,7 +712,7 @@ class Peernet {
711
712
  walks.push(walk(peer, peerId));
712
713
  }
713
714
  }
714
- return Promise.all(walks);
715
+ return Promise.race(walks);
715
716
  }
716
717
  /**
717
718
  * Override DHT behavior, try's finding the content three times
@@ -121,7 +121,7 @@ export default class Peernet {
121
121
  *
122
122
  * @param {String} hash
123
123
  */
124
- walk(hash: any): Promise<any[]>;
124
+ walk(hash: any): Promise<any>;
125
125
  /**
126
126
  * Override DHT behavior, try's finding the content three times
127
127
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "1.1.93",
3
+ "version": "1.1.94",
4
4
  "description": "",
5
5
  "browser": "./exports/browser/peernet.js",
6
6
  "exports": {
package/src/peernet.ts CHANGED
@@ -482,6 +482,7 @@ export default class Peernet {
482
482
  if (proto.decoded.has) this.dht.addProvider(peerInfo, proto.decoded.hash)
483
483
  } catch (error) {
484
484
  console.error(`Error while walking ${peerId}`, error)
485
+ return undefined
485
486
  }
486
487
  }
487
488
  let walks = []
@@ -490,7 +491,7 @@ export default class Peernet {
490
491
  walks.push(walk(peer, peerId))
491
492
  }
492
493
  }
493
- return Promise.all(walks)
494
+ return Promise.race(walks)
494
495
  }
495
496
 
496
497
  /**