@libp2p/utils 4.0.4 → 4.0.5-69581367

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,5 +1,3 @@
1
- # @libp2p/utils <!-- omit in toc -->
2
-
3
1
  [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4
2
  [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
5
3
  [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p)
@@ -7,22 +5,13 @@
7
5
 
8
6
  > Package to aggregate shared logic and dependencies for the libp2p ecosystem
9
7
 
10
- ## Table of contents <!-- omit in toc -->
11
-
12
- - [Install](#install)
13
- - [Browser `<script>` tag](#browser-script-tag)
14
- - [Usage](#usage)
15
- - [API Docs](#api-docs)
16
- - [License](#license)
17
- - [Contribution](#contribution)
18
-
19
- ## Install
8
+ # Install
20
9
 
21
10
  ```console
22
11
  $ npm i @libp2p/utils
23
12
  ```
24
13
 
25
- ### Browser `<script>` tag
14
+ ## Browser `<script>` tag
26
15
 
27
16
  Loading this module through a script tag will make it's exports available as `Libp2pUtils` in the global namespace.
28
17
 
@@ -30,36 +19,17 @@ Loading this module through a script tag will make it's exports available as `Li
30
19
  <script src="https://unpkg.com/@libp2p/utils/dist/index.min.js"></script>
31
20
  ```
32
21
 
33
- The libp2p ecosystem has lots of repos with it comes several problems like:
34
-
35
- - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
36
- - 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.
37
-
38
- These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
39
-
40
- ## Usage
41
-
42
- Each function should be imported directly.
43
-
44
- ```js
45
- import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
46
-
47
- const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
48
- ```
49
-
50
- You can check the [API docs](https://libp2p.github.io/js-libp2p-utils).
51
-
52
- ## API Docs
22
+ # API Docs
53
23
 
54
24
  - <https://libp2p.github.io/js-libp2p/modules/_libp2p_utils.html>
55
25
 
56
- ## License
26
+ # License
57
27
 
58
28
  Licensed under either of
59
29
 
60
30
  - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
61
31
  - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
62
32
 
63
- ## Contribution
33
+ # Contribution
64
34
 
65
35
  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,2 +1,22 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * The libp2p ecosystem has lots of repos with it comes several problems like:
5
+ *
6
+ * - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
7
+ * - 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.
8
+ *
9
+ * These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
10
+ *
11
+ * @example
12
+ *
13
+ * Each function should be imported directly.
14
+ *
15
+ * ```js
16
+ * import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
17
+ *
18
+ * const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
19
+ * ```
20
+ */
1
21
  export {};
2
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAA"}
package/dist/src/index.js CHANGED
@@ -1,2 +1,22 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * The libp2p ecosystem has lots of repos with it comes several problems like:
5
+ *
6
+ * - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
7
+ * - 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.
8
+ *
9
+ * These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
10
+ *
11
+ * @example
12
+ *
13
+ * Each function should be imported directly.
14
+ *
15
+ * ```js
16
+ * import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
17
+ *
18
+ * const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
19
+ * ```
20
+ */
1
21
  export {};
2
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/utils",
3
- "version": "4.0.4",
3
+ "version": "4.0.5-69581367",
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/tree/master/packages/utils#readme",
@@ -87,8 +87,8 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@chainsafe/is-ip": "^2.0.2",
90
- "@libp2p/interface": "^0.1.3",
91
- "@libp2p/logger": "^3.0.3",
90
+ "@libp2p/interface": "0.1.4-69581367",
91
+ "@libp2p/logger": "3.0.4-69581367",
92
92
  "@multiformats/multiaddr": "^12.1.5",
93
93
  "@multiformats/multiaddr-matcher": "^1.0.1",
94
94
  "is-loopback-addr": "^2.0.1",
package/src/index.ts CHANGED
@@ -1 +1,22 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * The libp2p ecosystem has lots of repos with it comes several problems like:
5
+ *
6
+ * - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
7
+ * - 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.
8
+ *
9
+ * These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
10
+ *
11
+ * @example
12
+ *
13
+ * Each function should be imported directly.
14
+ *
15
+ * ```js
16
+ * import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
17
+ *
18
+ * const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
19
+ * ```
20
+ */
21
+
1
22
  export {}
@@ -1,24 +0,0 @@
1
- {
2
- "certifiedAddressesFirst": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.certifiedAddressesFirst.html",
3
- "./address-sort:certifiedAddressesFirst": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.certifiedAddressesFirst.html",
4
- "circuitRelayAddressesLast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.circuitRelayAddressesLast.html",
5
- "./address-sort:circuitRelayAddressesLast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.circuitRelayAddressesLast.html",
6
- "defaultAddressSort": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.defaultAddressSort.html",
7
- "./address-sort:defaultAddressSort": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.defaultAddressSort.html",
8
- "publicAddressesFirst": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.publicAddressesFirst.html",
9
- "./address-sort:publicAddressesFirst": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.address_sort.publicAddressesFirst.html",
10
- "arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.array_equals.arrayEquals.html",
11
- "./array-equals:arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.array_equals.arrayEquals.html",
12
- "Errors": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.ip_port_to_multiaddr.Errors.html",
13
- "./ip-port-to-multiaddr:Errors": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.ip_port_to_multiaddr.Errors.html",
14
- "ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ip_port_to_multiaddr.ipPortToMultiaddr.html",
15
- "./ip-port-to-multiaddr:ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ip_port_to_multiaddr.ipPortToMultiaddr.html",
16
- "isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_loopback.isLoopback.html",
17
- "./multiaddr/is-loopback:isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_loopback.isLoopback.html",
18
- "isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_private.isPrivate.html",
19
- "./multiaddr/is-private:isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is_private.isPrivate.html",
20
- "StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.stream_to_ma_conn.StreamProperties.html",
21
- "./stream-to-ma-conn:StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.stream_to_ma_conn.StreamProperties.html",
22
- "streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.stream_to_ma_conn.streamToMaConnection.html",
23
- "./stream-to-ma-conn:streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.stream_to_ma_conn.streamToMaConnection.html"
24
- }