@libp2p/utils 5.2.2-2e464c099 → 5.2.2-72f0e09f7

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,14 +1,14 @@
1
1
  import { Queue, type QueueAddOptions } from './queue/index.js';
2
2
  import type { Job } from './queue/job.js';
3
3
  import type { PeerId } from '@libp2p/interface';
4
- export interface PeerQueueJobOptions extends QueueAddOptions {
4
+ export interface PeerQueueOptions extends QueueAddOptions {
5
5
  peerId: PeerId;
6
6
  }
7
7
  /**
8
8
  * Extends Queue to add support for querying queued jobs by peer id
9
9
  */
10
- export declare class PeerQueue<JobReturnType = void, JobOptions extends PeerQueueJobOptions = PeerQueueJobOptions> extends Queue<JobReturnType, JobOptions> {
10
+ export declare class PeerQueue<JobReturnType = void> extends Queue<JobReturnType, PeerQueueOptions> {
11
11
  has(peerId: PeerId): boolean;
12
- find(peerId: PeerId): Job<JobOptions, JobReturnType> | undefined;
12
+ find(peerId: PeerId): Job<PeerQueueOptions, JobReturnType> | undefined;
13
13
  }
14
14
  //# sourceMappingURL=peer-queue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"peer-queue.d.ts","sourceRoot":"","sources":["../../src/peer-queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,SAAS,CAAC,aAAa,GAAG,IAAI,EAAE,UAAU,SAAS,mBAAmB,GAAG,mBAAmB,CAAE,SAAQ,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC;IACjJ,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAI7B,IAAI,CAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,SAAS;CAKlE"}
1
+ {"version":3,"file":"peer-queue.d.ts","sourceRoot":"","sources":["../../src/peer-queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,SAAS,CAAC,aAAa,GAAG,IAAI,CAAE,SAAQ,KAAK,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzF,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAI7B,IAAI,CAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,GAAG,SAAS;CAKxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"peer-queue.js","sourceRoot":"","sources":["../../src/peer-queue.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,KAAK,EAAwB,MAAM,kBAAkB,CAAA;AAQ9D;;GAEG;AACH,MAAM,OAAO,SAA8F,SAAQ,KAAgC;IACjJ,GAAG,CAAE,MAAc;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;IAClC,CAAC;IAED,IAAI,CAAE,MAAc;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC3B,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"peer-queue.js","sourceRoot":"","sources":["../../src/peer-queue.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,KAAK,EAAwB,MAAM,kBAAkB,CAAA;AAQ9D;;GAEG;AACH,MAAM,OAAO,SAAgC,SAAQ,KAAsC;IACzF,GAAG,CAAE,MAAc;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;IAClC,CAAC;IAED,IAAI,CAAE,MAAc;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC3B,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/utils",
3
- "version": "5.2.2-2e464c099",
3
+ "version": "5.2.2-72f0e09f7",
4
4
  "description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/utils#readme",
@@ -127,8 +127,8 @@
127
127
  },
128
128
  "dependencies": {
129
129
  "@chainsafe/is-ip": "^2.0.2",
130
- "@libp2p/interface": "1.1.2-2e464c099",
131
- "@libp2p/logger": "4.0.5-2e464c099",
130
+ "@libp2p/interface": "1.1.2-72f0e09f7",
131
+ "@libp2p/logger": "4.0.5-72f0e09f7",
132
132
  "@multiformats/multiaddr": "^12.1.10",
133
133
  "@multiformats/multiaddr-matcher": "^1.1.0",
134
134
  "delay": "^6.0.0",
@@ -143,7 +143,7 @@
143
143
  "uint8arraylist": "^2.4.7"
144
144
  },
145
145
  "devDependencies": {
146
- "@libp2p/peer-id-factory": "4.0.5-2e464c099",
146
+ "@libp2p/peer-id-factory": "4.0.5-72f0e09f7",
147
147
  "@types/netmask": "^2.0.5",
148
148
  "aegir": "^42.0.0",
149
149
  "delay": "^6.0.0",
package/src/peer-queue.ts CHANGED
@@ -4,19 +4,19 @@ import { Queue, type QueueAddOptions } from './queue/index.js'
4
4
  import type { Job } from './queue/job.js'
5
5
  import type { PeerId } from '@libp2p/interface'
6
6
 
7
- export interface PeerQueueJobOptions extends QueueAddOptions {
7
+ export interface PeerQueueOptions extends QueueAddOptions {
8
8
  peerId: PeerId
9
9
  }
10
10
 
11
11
  /**
12
12
  * Extends Queue to add support for querying queued jobs by peer id
13
13
  */
14
- export class PeerQueue<JobReturnType = void, JobOptions extends PeerQueueJobOptions = PeerQueueJobOptions> extends Queue<JobReturnType, JobOptions> {
14
+ export class PeerQueue<JobReturnType = void> extends Queue<JobReturnType, PeerQueueOptions> {
15
15
  has (peerId: PeerId): boolean {
16
16
  return this.find(peerId) != null
17
17
  }
18
18
 
19
- find (peerId: PeerId): Job<JobOptions, JobReturnType> | undefined {
19
+ find (peerId: PeerId): Job<PeerQueueOptions, JobReturnType> | undefined {
20
20
  return this.queue.find(job => {
21
21
  return peerId.equals(job.options.peerId)
22
22
  })