@libp2p/utils 7.0.11-f4b950dc9 → 7.0.12
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 +1 -16
- package/dist/typedoc-urls.json +124 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -24,22 +24,7 @@ repo and examine the changes made.
|
|
|
24
24
|
|
|
25
25
|
-->
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
|
|
30
|
-
- 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.
|
|
31
|
-
|
|
32
|
-
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.
|
|
33
|
-
|
|
34
|
-
## Example
|
|
35
|
-
|
|
36
|
-
Each function should be imported directly.
|
|
37
|
-
|
|
38
|
-
```TypeScript
|
|
39
|
-
import { ipPortToMultiaddr } from '@libp2p/utils'
|
|
40
|
-
|
|
41
|
-
const ma = ipPortToMultiaddr('127.0.0.1', 9000)
|
|
42
|
-
```
|
|
27
|
+
This module contains utility functions used by libp2p modules.
|
|
43
28
|
|
|
44
29
|
# Install
|
|
45
30
|
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"AbstractMessageStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractMessageStream.html",
|
|
3
|
+
"AbstractMultiaddrConnection": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractMultiaddrConnection.html",
|
|
4
|
+
"AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractStream.html",
|
|
5
|
+
"AbstractStreamMuxer": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AbstractStreamMuxer.html",
|
|
6
|
+
"AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.AdaptiveTimeout.html",
|
|
7
|
+
"BloomFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.BloomFilter.html",
|
|
8
|
+
"CuckooFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.CuckooFilter.html",
|
|
9
|
+
"InvalidDataLengthError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.InvalidDataLengthError.html",
|
|
10
|
+
"InvalidDataLengthLengthError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.InvalidDataLengthLengthError.html",
|
|
11
|
+
"InvalidMessageLengthError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.InvalidMessageLengthError.html",
|
|
12
|
+
"LengthPrefixedDecoder": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.LengthPrefixedDecoder.html",
|
|
13
|
+
"MaxEarlyStreamsError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MaxEarlyStreamsError.html",
|
|
14
|
+
"MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MemoryStorage.html",
|
|
15
|
+
"MockStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MockStream.html",
|
|
16
|
+
"MovingAverage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.MovingAverage.html",
|
|
17
|
+
"PeerQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.PeerQueue.html",
|
|
18
|
+
"PriorityQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.PriorityQueue.html",
|
|
19
|
+
"Queue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.Queue.html",
|
|
20
|
+
"QueueFullError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.QueueFullError.html",
|
|
21
|
+
"RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.RateLimiter.html",
|
|
22
|
+
"RateLimitError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.RateLimitError.html",
|
|
23
|
+
"ScalableCuckooFilter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.ScalableCuckooFilter.html",
|
|
24
|
+
"StreamClosedError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.StreamClosedError.html",
|
|
25
|
+
"UnexpectedEOFError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.UnexpectedEOFError.html",
|
|
26
|
+
"UnwrappedError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.UnwrappedError.html",
|
|
27
|
+
"AbstractMultiaddrConnectionInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AbstractMultiaddrConnectionInit.html",
|
|
28
|
+
"AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AbstractStreamInit.html",
|
|
29
|
+
"AbstractStreamMuxerInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AbstractStreamMuxerInit.html",
|
|
30
|
+
"AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AdaptiveTimeoutInit.html",
|
|
31
|
+
"AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.AdaptiveTimeoutSignal.html",
|
|
32
|
+
"BloomFilterOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.BloomFilterOptions.html",
|
|
33
|
+
"Bucket": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Bucket.html",
|
|
34
|
+
"ByteStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ByteStream.html",
|
|
35
|
+
"ByteStreamOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ByteStreamOpts.html",
|
|
36
|
+
"Comparator": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Comparator.html",
|
|
37
|
+
"CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.CreateTrackedListInit.html",
|
|
38
|
+
"CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.CreateTrackedMapInit.html",
|
|
39
|
+
"CuckooFilterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.CuckooFilterInit.html",
|
|
40
|
+
"DebouncedFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DebouncedFunction.html",
|
|
41
|
+
"DNS4NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNS4NetConfig.html",
|
|
42
|
+
"DNS6NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNS6NetConfig.html",
|
|
43
|
+
"DNSAddrNetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNSAddrNetConfig.html",
|
|
44
|
+
"DNSNetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.DNSNetConfig.html",
|
|
45
|
+
"Filter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Filter.html",
|
|
46
|
+
"Fingerprint": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Fingerprint.html",
|
|
47
|
+
"GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.GetKeySecDurationOptions.html",
|
|
48
|
+
"GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.GetTimeoutSignalOptions.html",
|
|
49
|
+
"Hash": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Hash.html",
|
|
50
|
+
"IP4NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.IP4NetConfig.html",
|
|
51
|
+
"IP6NetConfig": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.IP6NetConfig.html",
|
|
52
|
+
"Job": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.Job.html",
|
|
53
|
+
"JobMatcher": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.JobMatcher.html",
|
|
54
|
+
"JobRecipient": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.JobRecipient.html",
|
|
55
|
+
"JobTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.JobTimeline.html",
|
|
56
|
+
"LengthPrefixedDecoderInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.LengthPrefixedDecoderInit.html",
|
|
57
|
+
"LengthPrefixedStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.LengthPrefixedStream.html",
|
|
58
|
+
"LengthPrefixedStreamOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.LengthPrefixedStreamOpts.html",
|
|
59
|
+
"MessageStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MessageStreamInit.html",
|
|
60
|
+
"MockMultiaddrConnectionInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MockMultiaddrConnectionInit.html",
|
|
61
|
+
"MockMuxedStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MockMuxedStreamInit.html",
|
|
62
|
+
"MultiaddrConnectionPairOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.MultiaddrConnectionPairOptions.html",
|
|
63
|
+
"PeerQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.PeerQueueJobOptions.html",
|
|
64
|
+
"PriorityQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.PriorityQueueJobOptions.html",
|
|
65
|
+
"ProtobufDecoder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufDecoder.html",
|
|
66
|
+
"ProtobufEncoder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufEncoder.html",
|
|
67
|
+
"ProtobufMessageStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufMessageStream.html",
|
|
68
|
+
"ProtobufStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufStream.html",
|
|
69
|
+
"ProtobufStreamOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ProtobufStreamOpts.html",
|
|
70
|
+
"QueueEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueEvents.html",
|
|
71
|
+
"QueueInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueInit.html",
|
|
72
|
+
"QueueJobFailure": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueJobFailure.html",
|
|
73
|
+
"QueueJobSuccess": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.QueueJobSuccess.html",
|
|
74
|
+
"RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RateLimiterInit.html",
|
|
75
|
+
"RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RateLimiterResult.html",
|
|
76
|
+
"RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RateRecord.html",
|
|
77
|
+
"ReadBytesOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ReadBytesOptions.html",
|
|
78
|
+
"RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RepeatingTask.html",
|
|
79
|
+
"RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RepeatingTaskOptions.html",
|
|
80
|
+
"RunFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.RunFunction.html",
|
|
81
|
+
"ScalableCuckooFilterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.ScalableCuckooFilterInit.html",
|
|
82
|
+
"SendResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.SendResult.html",
|
|
83
|
+
"StreamPairOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.StreamPairOptions.html",
|
|
84
|
+
"TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.TrackedMapInit.html",
|
|
85
|
+
"JobStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.JobStatus.html",
|
|
86
|
+
"NetConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.NetConfig.html",
|
|
87
|
+
"PipeInput": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.PipeInput.html",
|
|
88
|
+
"DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_FAILURE_MULTIPLIER.html",
|
|
89
|
+
"DEFAULT_INTERVAL": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_INTERVAL.html",
|
|
90
|
+
"DEFAULT_MAX_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_MAX_TIMEOUT.html",
|
|
91
|
+
"DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_MIN_TIMEOUT.html",
|
|
92
|
+
"DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.DEFAULT_TIMEOUT_MULTIPLIER.html",
|
|
93
|
+
"byteStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.byteStream.html",
|
|
94
|
+
"createBloomFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.createBloomFilter.html",
|
|
95
|
+
"createCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.createCuckooFilter.html",
|
|
96
|
+
"createScalableCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.createScalableCuckooFilter.html",
|
|
97
|
+
"debounce": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.debounce.html",
|
|
98
|
+
"echo": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.echo.html",
|
|
99
|
+
"echoStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.echoStream.html",
|
|
100
|
+
"getNetConfig": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.getNetConfig.html",
|
|
101
|
+
"getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.getThinWaistAddresses.html",
|
|
102
|
+
"ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ipPortToMultiaddr.html",
|
|
103
|
+
"isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isAsyncGenerator.html",
|
|
104
|
+
"isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isGenerator.html",
|
|
105
|
+
"isGlobalUnicast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isGlobalUnicast.html",
|
|
106
|
+
"isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isGlobalUnicastIp.html",
|
|
107
|
+
"isLinkLocal": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isLinkLocal.html",
|
|
108
|
+
"isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isLinkLocalIp.html",
|
|
109
|
+
"isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isLoopback.html",
|
|
110
|
+
"isNetworkAddress": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isNetworkAddress.html",
|
|
111
|
+
"isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isPrivate.html",
|
|
112
|
+
"isPrivateIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isPrivateIp.html",
|
|
113
|
+
"isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.isPromise.html",
|
|
114
|
+
"lpStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.lpStream.html",
|
|
115
|
+
"messageStreamToDuplex": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.messageStreamToDuplex.html",
|
|
116
|
+
"mockMuxer": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.mockMuxer.html",
|
|
117
|
+
"multiaddrConnectionPair": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddrConnectionPair.html",
|
|
118
|
+
"pbStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.pbStream.html",
|
|
119
|
+
"pipe": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.pipe.html",
|
|
120
|
+
"repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.repeatingTask.html",
|
|
121
|
+
"streamPair": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.streamPair.html",
|
|
122
|
+
"trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.trackedList.html",
|
|
123
|
+
"trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.trackedMap.html"
|
|
124
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/utils",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.12",
|
|
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/main/packages/utils#readme",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@chainsafe/is-ip": "^2.1.0",
|
|
48
48
|
"@chainsafe/netmask": "^2.0.0",
|
|
49
|
-
"@libp2p/crypto": "5.1.13
|
|
50
|
-
"@libp2p/interface": "3.1.0
|
|
51
|
-
"@libp2p/logger": "6.2.2
|
|
49
|
+
"@libp2p/crypto": "^5.1.13",
|
|
50
|
+
"@libp2p/interface": "^3.1.0",
|
|
51
|
+
"@libp2p/logger": "^6.2.2",
|
|
52
52
|
"@multiformats/multiaddr": "^13.0.1",
|
|
53
53
|
"@sindresorhus/fnv1a": "^3.1.0",
|
|
54
54
|
"any-signal": "^4.1.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"uint8arrays": "^5.1.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@libp2p/peer-id": "6.0.4
|
|
72
|
+
"@libp2p/peer-id": "^6.0.4",
|
|
73
73
|
"@types/netmask": "^2.0.5",
|
|
74
74
|
"aegir": "^47.0.22",
|
|
75
75
|
"benchmark": "^2.1.4",
|