@libp2p/peer-collections 4.0.10 → 5.0.0-09dd02987
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/src/index.d.ts +27 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +27 -0
- package/dist/src/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +27 -0
- package/dist/typedoc-urls.json +0 -5
package/dist/src/index.d.ts
CHANGED
|
@@ -4,6 +4,33 @@
|
|
|
4
4
|
* We can't use PeerIds as collection keys because collection keys are compared using same-value-zero equality, so this is just a group of collections that stringifies PeerIds before storing them.
|
|
5
5
|
*
|
|
6
6
|
* PeerIds cache stringified versions of themselves so this should be a cheap operation.
|
|
7
|
+
*
|
|
8
|
+
* @example Peer lists
|
|
9
|
+
*
|
|
10
|
+
* ```JavaScript
|
|
11
|
+
* import { peerList } from '@libp2p/peer-collections'
|
|
12
|
+
*
|
|
13
|
+
* const list = peerList()
|
|
14
|
+
* list.push(peerId)
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Peer maps
|
|
18
|
+
*
|
|
19
|
+
* ```JavaScript
|
|
20
|
+
* import { peerMap } from '@libp2p/peer-collections'
|
|
21
|
+
*
|
|
22
|
+
* const map = peerMap<string>()
|
|
23
|
+
* map.set(peerId, 'value')
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Peer sets
|
|
27
|
+
*
|
|
28
|
+
* ```JavaScript
|
|
29
|
+
* import { peerSet } from '@libp2p/peer-collections'
|
|
30
|
+
*
|
|
31
|
+
* const set = peerSet()
|
|
32
|
+
* set.add(peerId)
|
|
33
|
+
* ```
|
|
7
34
|
*/
|
|
8
35
|
export { PeerMap } from './map.js';
|
|
9
36
|
export { PeerSet } from './set.js';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -4,6 +4,33 @@
|
|
|
4
4
|
* We can't use PeerIds as collection keys because collection keys are compared using same-value-zero equality, so this is just a group of collections that stringifies PeerIds before storing them.
|
|
5
5
|
*
|
|
6
6
|
* PeerIds cache stringified versions of themselves so this should be a cheap operation.
|
|
7
|
+
*
|
|
8
|
+
* @example Peer lists
|
|
9
|
+
*
|
|
10
|
+
* ```JavaScript
|
|
11
|
+
* import { peerList } from '@libp2p/peer-collections'
|
|
12
|
+
*
|
|
13
|
+
* const list = peerList()
|
|
14
|
+
* list.push(peerId)
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Peer maps
|
|
18
|
+
*
|
|
19
|
+
* ```JavaScript
|
|
20
|
+
* import { peerMap } from '@libp2p/peer-collections'
|
|
21
|
+
*
|
|
22
|
+
* const map = peerMap<string>()
|
|
23
|
+
* map.set(peerId, 'value')
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Peer sets
|
|
27
|
+
*
|
|
28
|
+
* ```JavaScript
|
|
29
|
+
* import { peerSet } from '@libp2p/peer-collections'
|
|
30
|
+
*
|
|
31
|
+
* const set = peerSet()
|
|
32
|
+
* set.add(peerId)
|
|
33
|
+
* ```
|
|
7
34
|
*/
|
|
8
35
|
export { PeerMap } from './map.js';
|
|
9
36
|
export { PeerSet } from './set.js';
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/peer-collections",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-09dd02987",
|
|
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",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"test:electron-main": "aegir test -t electron-main"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@libp2p/interface": "
|
|
57
|
-
"@libp2p/peer-id": "
|
|
56
|
+
"@libp2p/interface": "1.0.1-09dd02987",
|
|
57
|
+
"@libp2p/peer-id": "4.0.1-09dd02987"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@libp2p/peer-id-factory": "
|
|
60
|
+
"@libp2p/peer-id-factory": "4.0.0-09dd02987",
|
|
61
61
|
"aegir": "^41.0.2"
|
|
62
62
|
}
|
|
63
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,33 @@
|
|
|
4
4
|
* We can't use PeerIds as collection keys because collection keys are compared using same-value-zero equality, so this is just a group of collections that stringifies PeerIds before storing them.
|
|
5
5
|
*
|
|
6
6
|
* PeerIds cache stringified versions of themselves so this should be a cheap operation.
|
|
7
|
+
*
|
|
8
|
+
* @example Peer lists
|
|
9
|
+
*
|
|
10
|
+
* ```JavaScript
|
|
11
|
+
* import { peerList } from '@libp2p/peer-collections'
|
|
12
|
+
*
|
|
13
|
+
* const list = peerList()
|
|
14
|
+
* list.push(peerId)
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Peer maps
|
|
18
|
+
*
|
|
19
|
+
* ```JavaScript
|
|
20
|
+
* import { peerMap } from '@libp2p/peer-collections'
|
|
21
|
+
*
|
|
22
|
+
* const map = peerMap<string>()
|
|
23
|
+
* map.set(peerId, 'value')
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Peer sets
|
|
27
|
+
*
|
|
28
|
+
* ```JavaScript
|
|
29
|
+
* import { peerSet } from '@libp2p/peer-collections'
|
|
30
|
+
*
|
|
31
|
+
* const set = peerSet()
|
|
32
|
+
* set.add(peerId)
|
|
33
|
+
* ```
|
|
7
34
|
*/
|
|
8
35
|
|
|
9
36
|
export { PeerMap } from './map.js'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"PeerList": "https://libp2p.github.io/js-libp2p/classes/_libp2p_peer_collections.PeerList.html",
|
|
3
|
-
"PeerMap": "https://libp2p.github.io/js-libp2p/classes/_libp2p_peer_collections.PeerMap.html",
|
|
4
|
-
"PeerSet": "https://libp2p.github.io/js-libp2p/classes/_libp2p_peer_collections.PeerSet.html"
|
|
5
|
-
}
|