@libp2p/utils 1.0.10 → 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 +31 -18
- package/dist/src/address-sort.d.ts +1 -1
- package/dist/src/address-sort.d.ts.map +1 -1
- package/dist/src/stream-to-ma-conn.d.ts +1 -1
- package/package.json +20 -18
- package/src/address-sort.ts +1 -1
- package/src/stream-to-ma-conn.ts +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @libp2p/utils <!-- omit in toc -->
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.com/libp2p/js-libp2p-utils)
|
|
9
|
-
[](https://david-dm.org/libp2p/js-libp2p-utils)
|
|
10
|
-
[](https://github.com/feross/standard)
|
|
3
|
+
[](http://libp2p.io/)
|
|
4
|
+
[](http://webchat.freenode.net/?channels=%23libp2p)
|
|
5
|
+
[](https://discuss.libp2p.io)
|
|
6
|
+
[](https://codecov.io/gh/libp2p/js-libp2p-utils)
|
|
7
|
+
[](https://github.com/libp2p/js-libp2p-utils/actions/workflows/js-test-and-release.yml)
|
|
11
8
|
|
|
12
|
-
>
|
|
9
|
+
> Package to aggregate shared logic and dependencies for the libp2p ecosystem
|
|
13
10
|
|
|
11
|
+
## Table of contents <!-- omit in toc -->
|
|
12
|
+
|
|
13
|
+
- [Install](#install)
|
|
14
|
+
- [Lead Maintainer](#lead-maintainer)
|
|
15
|
+
- [Usage](#usage)
|
|
16
|
+
- [Contribute](#contribute)
|
|
17
|
+
- [License](#license)
|
|
18
|
+
- [Contribution](#contribution)
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```console
|
|
23
|
+
$ npm i @libp2p/utils
|
|
24
|
+
```
|
|
14
25
|
|
|
15
26
|
The libp2p ecosystem has lots of repos with it comes several problems like:
|
|
27
|
+
|
|
16
28
|
- Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
|
|
17
29
|
- Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc.
|
|
18
30
|
|
|
@@ -22,14 +34,8 @@ These problems are the motivation for this package, having shared logic in this
|
|
|
22
34
|
|
|
23
35
|
[Vasco Santos](https://github.com/vasco-santos)
|
|
24
36
|
|
|
25
|
-
## Install
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
$ npm install --save @libp2p/utils
|
|
30
|
-
```
|
|
31
|
-
|
|
32
37
|
## Usage
|
|
38
|
+
|
|
33
39
|
Each function should be imported directly.
|
|
34
40
|
|
|
35
41
|
```js
|
|
@@ -48,4 +54,11 @@ Check out our [contributing document](https://github.com/ipfs/community/blob/mas
|
|
|
48
54
|
|
|
49
55
|
## License
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
Licensed under either of
|
|
58
|
+
|
|
59
|
+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
60
|
+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
61
|
+
|
|
62
|
+
## Contribution
|
|
63
|
+
|
|
64
|
+
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-sort.d.ts","sourceRoot":"","sources":["../../src/address-sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"address-sort.d.ts","sourceRoot":"","sources":["../../src/address-sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAG3D;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAiBxE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
2
|
-
import type { MultiaddrConnection } from '@libp2p/
|
|
2
|
+
import type { MultiaddrConnection } from '@libp2p/interface-connection';
|
|
3
3
|
import type { Duplex } from 'it-stream-types';
|
|
4
4
|
export interface Timeline {
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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-utils#readme",
|
|
@@ -41,31 +41,32 @@
|
|
|
41
41
|
],
|
|
42
42
|
"exports": {
|
|
43
43
|
".": {
|
|
44
|
+
"types": "./src/index.d.ts",
|
|
44
45
|
"import": "./dist/src/index.js"
|
|
45
46
|
},
|
|
46
47
|
"./address-sort": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
48
|
+
"types": "./dist/src/address-sort.d.ts",
|
|
49
|
+
"import": "./dist/src/address-sort.js"
|
|
49
50
|
},
|
|
50
51
|
"./array-equals": {
|
|
51
|
-
"
|
|
52
|
-
"
|
|
52
|
+
"types": "./dist/src/array-equals.d.ts",
|
|
53
|
+
"import": "./dist/src/array-equals.js"
|
|
53
54
|
},
|
|
54
55
|
"./ip-port-to-multiaddr": {
|
|
55
|
-
"
|
|
56
|
-
"
|
|
56
|
+
"types": "./dist/src/ip-port-to-multiaddr.d.ts",
|
|
57
|
+
"import": "./dist/src/ip-port-to-multiaddr.js"
|
|
57
58
|
},
|
|
58
59
|
"./multiaddr/is-loopback": {
|
|
59
|
-
"
|
|
60
|
-
"
|
|
60
|
+
"types": "./dist/src/multiaddr/is-loopback.d.ts",
|
|
61
|
+
"import": "./dist/src/multiaddr/is-loopback.js"
|
|
61
62
|
},
|
|
62
63
|
"./multiaddr/is-private": {
|
|
63
|
-
"
|
|
64
|
-
"
|
|
64
|
+
"types": "./dist/src/multiaddr/is-private.d.ts",
|
|
65
|
+
"import": "./dist/src/multiaddr/is-private.js"
|
|
65
66
|
},
|
|
66
67
|
"./stream-to-ma-conn": {
|
|
67
|
-
"
|
|
68
|
-
"
|
|
68
|
+
"types": "./dist/src/stream-to-ma-conn.d.ts",
|
|
69
|
+
"import": "./dist/src/stream-to-ma-conn.js"
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
72
|
"eslintConfig": {
|
|
@@ -171,19 +172,20 @@
|
|
|
171
172
|
},
|
|
172
173
|
"dependencies": {
|
|
173
174
|
"@achingbrain/ip-address": "^8.1.0",
|
|
174
|
-
"@libp2p/
|
|
175
|
+
"@libp2p/interface-connection": "^1.0.1",
|
|
176
|
+
"@libp2p/interface-peer-store": "^1.0.0",
|
|
177
|
+
"@libp2p/interface-transport": "^1.0.0",
|
|
178
|
+
"@libp2p/logger": "^2.0.0",
|
|
175
179
|
"@multiformats/multiaddr": "^10.1.1",
|
|
176
180
|
"abortable-iterator": "^4.0.2",
|
|
177
181
|
"err-code": "^3.0.1",
|
|
178
182
|
"is-loopback-addr": "^2.0.1",
|
|
179
183
|
"it-stream-types": "^1.0.4",
|
|
180
|
-
"private-ip": "^2.1.1"
|
|
181
|
-
"ts-mocha": "^9.0.2",
|
|
182
|
-
"ts-node": "^10.7.0"
|
|
184
|
+
"private-ip": "^2.1.1"
|
|
183
185
|
},
|
|
184
186
|
"devDependencies": {
|
|
185
187
|
"@libp2p/interfaces": "^1.0.3",
|
|
186
|
-
"aegir": "^37.0
|
|
188
|
+
"aegir": "^37.2.0",
|
|
187
189
|
"it-all": "^1.0.6",
|
|
188
190
|
"it-pair": "^2.0.2",
|
|
189
191
|
"it-pipe": "^2.0.2",
|
package/src/address-sort.ts
CHANGED
package/src/stream-to-ma-conn.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { abortableSource } from 'abortable-iterator'
|
|
2
2
|
import { logger } from '@libp2p/logger'
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
|
-
import type { MultiaddrConnection } from '@libp2p/
|
|
4
|
+
import type { MultiaddrConnection } from '@libp2p/interface-connection'
|
|
5
5
|
import type { Duplex } from 'it-stream-types'
|
|
6
6
|
|
|
7
7
|
const log = logger('libp2p:stream:converter')
|