@peerbit/shared-log 10.4.0 → 10.4.1-5652381

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/src/ranges.ts CHANGED
@@ -2370,7 +2370,11 @@ export const matchEntriesInRangeQuery = (range: {
2370
2370
  }),
2371
2371
  ]);
2372
2372
 
2373
- if (range.start2 === range.end2) {
2373
+ // if range2 has length 0 or range 2 is equal to range 1 only make one query
2374
+ if (
2375
+ range.start2 === range.end2 ||
2376
+ (range.start1 === range.start2 && range.end1 === range.end2)
2377
+ ) {
2374
2378
  return c1;
2375
2379
  }
2376
2380
 
@@ -26,7 +26,7 @@ export type ReplicationDomainCoverSet<Args> = (
26
26
  args: Args,
27
27
  ) => Promise<string[]> | string[]; // minimum set of peers that covers all the data
28
28
 
29
- type CoverRange<T extends number | bigint> = {
29
+ export type CoverRange<T extends number | bigint> = {
30
30
  offset: T | PublicSignKey;
31
31
  length?: T;
32
32
  };