@libp2p/peer-collections 1.0.3 → 2.0.0
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/README.md +22 -16
- package/dist/src/list.d.ts +1 -1
- package/dist/src/list.d.ts.map +1 -1
- package/dist/src/map.d.ts +1 -1
- package/dist/src/map.d.ts.map +1 -1
- package/dist/src/set.d.ts +1 -1
- package/dist/src/set.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/list.ts +1 -1
- package/src/map.ts +1 -1
- package/src/set.ts +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
# libp2p
|
|
1
|
+
# @libp2p/peer-collections <!-- omit in toc -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](http://libp2p.io/)
|
|
4
|
+
[](http://webchat.freenode.net/?channels=%23libp2p)
|
|
5
|
+
[](https://discuss.libp2p.io)
|
|
6
|
+
[](https://codecov.io/gh/libp2p/js-libp2p-peer-collections)
|
|
7
|
+
[](https://github.com/libp2p/js-libp2p-peer-collections/actions/workflows/js-test-and-release.yml)
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
> Stores values against a peer id
|
|
6
10
|
|
|
11
|
+
## Table of contents <!-- omit in toc -->
|
|
12
|
+
|
|
13
|
+
- [Install](#install)
|
|
7
14
|
- [Description](#description)
|
|
8
15
|
- [Example](#example)
|
|
9
|
-
- [Installation](#installation)
|
|
10
16
|
- [License](#license)
|
|
11
|
-
|
|
17
|
+
- [Contribution](#contribution)
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```console
|
|
22
|
+
$ npm i @libp2p/peer-collections
|
|
23
|
+
```
|
|
12
24
|
|
|
13
25
|
## Description
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
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.
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
PeerIds cache stringified versions of themselves so this should be a cheap operation.
|
|
18
30
|
|
|
19
31
|
## Example
|
|
20
32
|
|
|
@@ -31,19 +43,13 @@ const list = peerList()
|
|
|
31
43
|
list.push(peerId)
|
|
32
44
|
```
|
|
33
45
|
|
|
34
|
-
## Installation
|
|
35
|
-
|
|
36
|
-
```console
|
|
37
|
-
$ npm i @libp2p/peer-collections
|
|
38
|
-
```
|
|
39
|
-
|
|
40
46
|
## License
|
|
41
47
|
|
|
42
48
|
Licensed under either of
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
51
|
+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
## Contribution
|
|
48
54
|
|
|
49
55
|
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
|
package/dist/src/list.d.ts
CHANGED
package/dist/src/list.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;gBAElB,IAAI,CAAC,EAAE,QAAQ;IAU5B,CAAC,MAAM,CAAC,QAAQ,CAAC;IASjB,MAAM,CAAE,IAAI,EAAE,QAAQ;IAUtB,OAAO,IAAK,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAS9C,KAAK,CAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,KAAK,OAAO,GAAG,OAAO;IAMrF,MAAM,CAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,KAAK,OAAO,GAAG,QAAQ;IAcvF,IAAI,CAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,KAAK,OAAO,GAAG,MAAM,GAAG,SAAS;IAY/F,SAAS,CAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,KAAK,OAAO,GAAG,MAAM;IAMxF,OAAO,CAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAMjF,QAAQ,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAIlC,OAAO,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAIhC,GAAG,IAAK,MAAM,GAAG,SAAS;IAU1B,IAAI,CAAE,GAAG,OAAO,EAAE,MAAM,EAAE;IAM1B,KAAK,IAAK,MAAM,GAAG,SAAS;IAU5B,OAAO,CAAE,GAAG,OAAO,EAAE,MAAM,EAAE;IAU7B,IAAI,MAAM,WAET;CACF"}
|
package/dist/src/map.d.ts
CHANGED
package/dist/src/map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD;;;;;;;GAOG;AACH,qBAAa,OAAO,CAAE,CAAC;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;gBAEvB,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAU7B,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB,KAAK;IAIL,MAAM,CAAE,IAAI,EAAE,MAAM;IAIpB,OAAO,IAAK,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IASzC,OAAO,CAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IAMpE,GAAG,CAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAIjC,GAAG,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAI3B,GAAG,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAI3B,IAAI,IAAK,gBAAgB,CAAC,MAAM,CAAC;IASjC,MAAM;IAIN,IAAI,IAAI,WAEP;CACF"}
|
package/dist/src/set.d.ts
CHANGED
package/dist/src/set.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD;;;;;;;GAOG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;gBAEpB,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC;IAU7C,IAAI,IAAI,WAEP;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB,GAAG,CAAE,IAAI,EAAE,MAAM;IAIjB,KAAK;IAIL,MAAM,CAAE,IAAI,EAAE,MAAM;IAIpB,OAAO,IAAK,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAW9C,OAAO,CAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;IAQhF,GAAG,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAI3B,MAAM;CAQP"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/peer-collections",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Stores values against a peer id",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
|
-
"homepage": "https://github.com/libp2p/js-libp2p-
|
|
6
|
+
"homepage": "https://github.com/libp2p/js-libp2p-peer-collections#readme",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/libp2p/js-libp2p-
|
|
9
|
+
"url": "git+https://github.com/libp2p/js-libp2p-peer-collections.git"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/libp2p/js-libp2p-
|
|
12
|
+
"url": "https://github.com/libp2p/js-libp2p-peer-collections/issues"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"IPFS"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
+
"types": "./dist/src/index.d.ts",
|
|
31
32
|
"import": "./dist/src/index.js"
|
|
32
33
|
}
|
|
33
34
|
},
|
|
@@ -133,7 +134,7 @@
|
|
|
133
134
|
"release": "aegir release"
|
|
134
135
|
},
|
|
135
136
|
"dependencies": {
|
|
136
|
-
"@libp2p/
|
|
137
|
+
"@libp2p/interface-peer-id": "^1.0.4",
|
|
137
138
|
"@libp2p/peer-id": "^1.1.0"
|
|
138
139
|
},
|
|
139
140
|
"devDependencies": {
|
package/src/list.ts
CHANGED
package/src/map.ts
CHANGED
package/src/set.ts
CHANGED