@libp2p/peer-collections 6.0.27 → 6.0.28-aa25d38ab
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.min.js +2 -15
- package/dist/index.min.js.map +7 -0
- package/dist/src/filter.d.ts +18 -1
- package/dist/src/filter.d.ts.map +1 -1
- package/dist/src/filter.js +18 -1
- package/dist/src/filter.js.map +1 -1
- package/dist/src/tracked-list.d.ts +1 -1
- package/dist/src/tracked-list.js +1 -1
- package/dist/src/tracked-map.d.ts +1 -1
- package/dist/src/tracked-map.js +1 -1
- package/dist/src/tracked-set.d.ts +1 -1
- package/dist/src/tracked-set.js +1 -1
- package/package.json +9 -16
- package/src/filter.ts +18 -1
- package/src/tracked-list.ts +1 -1
- package/src/tracked-map.ts +1 -1
- package/src/tracked-set.ts +1 -1
- package/dist/typedoc-urls.json +0 -16
package/dist/src/filter.d.ts
CHANGED
|
@@ -11,7 +11,24 @@ export declare class PeerFilter {
|
|
|
11
11
|
remove(peerId: PeerId): void;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Create and return a PeerFilter
|
|
14
|
+
* Create and return a PeerFilter. This can be used by topologies to prevent
|
|
15
|
+
* them receiving duplicate notifications for a peer that connects repeatedly.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* ```TypeScript
|
|
20
|
+
* import { peerFilter } from '@libp2p/peer-collections'
|
|
21
|
+
* import type { Registrar } from '@libp2p/interface-internal'
|
|
22
|
+
*
|
|
23
|
+
* const registrar: Registrar
|
|
24
|
+
*
|
|
25
|
+
* registrar.register('/my/protocol/1.0.0', {
|
|
26
|
+
* filter: peerFilter(),
|
|
27
|
+
* onConnect: (peerId) => {
|
|
28
|
+
* // will only be invoked for a given peerId once
|
|
29
|
+
* }
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
15
32
|
*
|
|
16
33
|
* @param size - The maximum number of peers expected to be added to the filter
|
|
17
34
|
* @param errorRate - The acceptable error rate
|
package/dist/src/filter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/filter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAElB,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAI7C,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAI7B,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAI1B,MAAM,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAG9B;AAED
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/filter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAElB,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAI7C,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAI7B,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAI1B,MAAM,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAG9B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAAc,GAAG,UAAU,CAE/E"}
|
package/dist/src/filter.js
CHANGED
|
@@ -19,7 +19,24 @@ export class PeerFilter {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Create and return a PeerFilter
|
|
22
|
+
* Create and return a PeerFilter. This can be used by topologies to prevent
|
|
23
|
+
* them receiving duplicate notifications for a peer that connects repeatedly.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
*
|
|
27
|
+
* ```TypeScript
|
|
28
|
+
* import { peerFilter } from '@libp2p/peer-collections'
|
|
29
|
+
* import type { Registrar } from '@libp2p/interface-internal'
|
|
30
|
+
*
|
|
31
|
+
* const registrar: Registrar
|
|
32
|
+
*
|
|
33
|
+
* registrar.register('/my/protocol/1.0.0', {
|
|
34
|
+
* filter: peerFilter(),
|
|
35
|
+
* onConnect: (peerId) => {
|
|
36
|
+
* // will only be invoked for a given peerId once
|
|
37
|
+
* }
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
23
40
|
*
|
|
24
41
|
* @param size - The maximum number of peers expected to be added to the filter
|
|
25
42
|
* @param errorRate - The acceptable error rate
|
package/dist/src/filter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../src/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAIlE;;;GAGG;AACH,MAAM,OAAO,UAAU;IACJ,MAAM,CAAQ;IAE/B,YAAa,IAAY,EAAE,SAAkB;QAC3C,IAAI,CAAC,MAAM,GAAG,0BAA0B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;IAC3D,CAAC;IAED,GAAG,CAAE,MAAc;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAA;IACpD,CAAC;IAED,GAAG,CAAE,MAAc;QACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAA;IAClD,CAAC;CACF;AAED
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../src/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAIlE;;;GAGG;AACH,MAAM,OAAO,UAAU;IACJ,MAAM,CAAQ;IAE/B,YAAa,IAAY,EAAE,SAAkB;QAC3C,IAAI,CAAC,MAAM,GAAG,0BAA0B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;IAC3D,CAAC;IAED,GAAG,CAAE,MAAc;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAA;IACpD,CAAC;IAED,GAAG,CAAE,MAAc;QACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAA;IAClD,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,UAAU,CAAE,IAAY,EAAE,YAAoB,KAAK;IACjE,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;AACxC,CAAC"}
|
package/dist/src/tracked-list.js
CHANGED
package/dist/src/tracked-map.js
CHANGED
package/dist/src/tracked-set.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/peer-collections",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.28-aa25d38ab",
|
|
4
4
|
"description": "Stores values against a peer id",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-collections#readme",
|
|
@@ -32,13 +32,6 @@
|
|
|
32
32
|
"import": "./dist/src/index.js"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"eslintConfig": {
|
|
36
|
-
"extends": "ipfs",
|
|
37
|
-
"parserOptions": {
|
|
38
|
-
"project": true,
|
|
39
|
-
"sourceType": "module"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
35
|
"scripts": {
|
|
43
36
|
"clean": "aegir clean",
|
|
44
37
|
"lint": "aegir lint",
|
|
@@ -54,16 +47,16 @@
|
|
|
54
47
|
"test:electron-main": "aegir test -t electron-main"
|
|
55
48
|
},
|
|
56
49
|
"dependencies": {
|
|
57
|
-
"@libp2p/interface": "
|
|
58
|
-
"@libp2p/peer-id": "
|
|
59
|
-
"@libp2p/utils": "
|
|
60
|
-
"multiformats": "^13.3.
|
|
50
|
+
"@libp2p/interface": "2.10.0-aa25d38ab",
|
|
51
|
+
"@libp2p/peer-id": "5.1.3-aa25d38ab",
|
|
52
|
+
"@libp2p/utils": "6.6.3-aa25d38ab",
|
|
53
|
+
"multiformats": "^13.3.4"
|
|
61
54
|
},
|
|
62
55
|
"devDependencies": {
|
|
63
|
-
"@libp2p/crypto": "
|
|
64
|
-
"@types/sinon": "^17.0.
|
|
65
|
-
"aegir": "^
|
|
66
|
-
"sinon": "^
|
|
56
|
+
"@libp2p/crypto": "5.1.2-aa25d38ab",
|
|
57
|
+
"@types/sinon": "^17.0.4",
|
|
58
|
+
"aegir": "^47.0.6",
|
|
59
|
+
"sinon": "^20.0.0",
|
|
67
60
|
"sinon-ts": "^2.0.0"
|
|
68
61
|
},
|
|
69
62
|
"sideEffects": false
|
package/src/filter.ts
CHANGED
|
@@ -27,7 +27,24 @@ export class PeerFilter {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Create and return a PeerFilter
|
|
30
|
+
* Create and return a PeerFilter. This can be used by topologies to prevent
|
|
31
|
+
* them receiving duplicate notifications for a peer that connects repeatedly.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
*
|
|
35
|
+
* ```TypeScript
|
|
36
|
+
* import { peerFilter } from '@libp2p/peer-collections'
|
|
37
|
+
* import type { Registrar } from '@libp2p/interface-internal'
|
|
38
|
+
*
|
|
39
|
+
* const registrar: Registrar
|
|
40
|
+
*
|
|
41
|
+
* registrar.register('/my/protocol/1.0.0', {
|
|
42
|
+
* filter: peerFilter(),
|
|
43
|
+
* onConnect: (peerId) => {
|
|
44
|
+
* // will only be invoked for a given peerId once
|
|
45
|
+
* }
|
|
46
|
+
* })
|
|
47
|
+
* ```
|
|
31
48
|
*
|
|
32
49
|
* @param size - The maximum number of peers expected to be added to the filter
|
|
33
50
|
* @param errorRate - The acceptable error rate
|
package/src/tracked-list.ts
CHANGED
package/src/tracked-map.ts
CHANGED
package/src/tracked-set.ts
CHANGED
package/dist/typedoc-urls.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"PeerFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_peer_collections.PeerFilter.html",
|
|
3
|
-
"PeerList": "https://libp2p.github.io/js-libp2p/classes/_libp2p_peer_collections.PeerList.html",
|
|
4
|
-
"PeerMap": "https://libp2p.github.io/js-libp2p/classes/_libp2p_peer_collections.PeerMap.html",
|
|
5
|
-
"PeerSet": "https://libp2p.github.io/js-libp2p/classes/_libp2p_peer_collections.PeerSet.html",
|
|
6
|
-
"TrackedPeerListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_peer_collections.TrackedPeerListInit.html",
|
|
7
|
-
"TrackedPeerMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_peer_collections.TrackedPeerMapInit.html",
|
|
8
|
-
"TrackedPeerSetInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_peer_collections.TrackedPeerSetInit.html",
|
|
9
|
-
"peerFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.peerFilter-1.html",
|
|
10
|
-
"peerList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.peerList-1.html",
|
|
11
|
-
"peerMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.peerMap-1.html",
|
|
12
|
-
"peerSet": "https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.peerSet-1.html",
|
|
13
|
-
"trackedPeerList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.trackedPeerList.html",
|
|
14
|
-
"trackedPeerMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.trackedPeerMap.html",
|
|
15
|
-
"trackedPeerSet": "https://libp2p.github.io/js-libp2p/functions/_libp2p_peer_collections.trackedPeerSet.html"
|
|
16
|
-
}
|