@libp2p/peer-collections 1.0.1 → 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 CHANGED
@@ -1,20 +1,32 @@
1
- # libp2p-peer-connections <!-- omit in toc -->
1
+ # @libp2p/peer-collections <!-- omit in toc -->
2
2
 
3
- > store values against peer ids
3
+ [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4
+ [![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
5
+ [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
6
+ [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-peer-collections.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-peer-collections)
7
+ [![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-peer-collections/actions/workflows/js-test-and-release.yml)
4
8
 
5
- ## Table of Contents <!-- omit in toc -->
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
- - [Contribution](#contribution)
17
+ - [Contribution](#contribution)
18
+
19
+ ## Install
20
+
21
+ ```console
22
+ $ npm i @libp2p/peer-collections
23
+ ```
12
24
 
13
25
  ## Description
14
26
 
15
- 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.
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
- PeerIds cache stringified versions of themselves so this should be a cheap operation.
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
- * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
45
- * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
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
- ### Contribution
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.
@@ -1,4 +1,4 @@
1
- import type { PeerId } from '@libp2p/interfaces/peer-id';
1
+ import type { PeerId } from '@libp2p/interface-peer-id';
2
2
  /**
3
3
  * We can't use PeerIds as list entries because list entries are
4
4
  * compared using same-value-zero equality, so this is just
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAIxD;;;;;;;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,EA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,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
@@ -1,4 +1,4 @@
1
- import type { PeerId } from '@libp2p/interfaces/peer-id';
1
+ import type { PeerId } from '@libp2p/interface-peer-id';
2
2
  /**
3
3
  * We can't use PeerIds as map keys because map keys are
4
4
  * compared using same-value-zero equality, so this is just
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/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AE,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
@@ -1,4 +1,4 @@
1
- import type { PeerId } from '@libp2p/interfaces/peer-id';
1
+ import type { PeerId } from '@libp2p/interface-peer-id';
2
2
  /**
3
3
  * We can't use PeerIds as set entries because set entries are
4
4
  * compared using same-value-zero equality, so this is just
@@ -1 +1 @@
1
- {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAIxD;;;;;;;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"}
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": "1.0.1",
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-interfaces/tree/master/packages/libp2p-peer-collections#readme",
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-interfaces.git"
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-interfaces/issues"
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,10 +134,10 @@
133
134
  "release": "aegir release"
134
135
  },
135
136
  "dependencies": {
136
- "@libp2p/interfaces": "^1.3.0"
137
+ "@libp2p/interface-peer-id": "^1.0.4",
138
+ "@libp2p/peer-id": "^1.1.0"
137
139
  },
138
140
  "devDependencies": {
139
- "@libp2p/peer-id": "^1.1.0",
140
141
  "@libp2p/peer-id-factory": "^1.0.0",
141
142
  "aegir": "^37.0.7"
142
143
  }
package/src/list.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PeerId } from '@libp2p/interfaces/peer-id'
1
+ import type { PeerId } from '@libp2p/interface-peer-id'
2
2
  import { peerIdFromString } from '@libp2p/peer-id'
3
3
  import { mapIterable } from './util.js'
4
4
 
package/src/map.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PeerId } from '@libp2p/interfaces/peer-id'
1
+ import type { PeerId } from '@libp2p/interface-peer-id'
2
2
  import { peerIdFromString } from '@libp2p/peer-id'
3
3
  import { mapIterable } from './util.js'
4
4
 
package/src/set.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PeerId } from '@libp2p/interfaces/peer-id'
1
+ import type { PeerId } from '@libp2p/interface-peer-id'
2
2
  import { peerIdFromString } from '@libp2p/peer-id'
3
3
  import { mapIterable } from './util.js'
4
4