@libp2p/utils 6.6.3 → 6.6.4
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/dist/src/abstract-stream.d.ts +1 -1
- package/dist/src/abstract-stream.d.ts.map +1 -1
- package/dist/src/abstract-stream.js +6 -7
- package/dist/src/abstract-stream.js.map +1 -1
- package/dist/src/adaptive-timeout.d.ts +1 -1
- package/dist/src/adaptive-timeout.d.ts.map +1 -1
- package/dist/src/adaptive-timeout.js.map +1 -1
- package/dist/src/debounce.js.map +1 -1
- package/dist/src/filters/cuckoo-filter.d.ts +1 -1
- package/dist/src/filters/cuckoo-filter.d.ts.map +1 -1
- package/dist/src/filters/cuckoo-filter.js.map +1 -1
- package/dist/src/filters/fingerprint.d.ts +1 -1
- package/dist/src/filters/fingerprint.d.ts.map +1 -1
- package/dist/src/filters/scalable-cuckoo-filter.d.ts +1 -1
- package/dist/src/filters/scalable-cuckoo-filter.d.ts.map +1 -1
- package/dist/src/filters/scalable-cuckoo-filter.js.map +1 -1
- package/dist/src/ip-port-to-multiaddr.d.ts +1 -1
- package/dist/src/ip-port-to-multiaddr.d.ts.map +1 -1
- package/dist/src/ip-port-to-multiaddr.js +1 -1
- package/dist/src/ip-port-to-multiaddr.js.map +1 -1
- package/dist/src/merge-options.d.ts +7 -0
- package/dist/src/merge-options.d.ts.map +1 -0
- package/dist/src/merge-options.js +128 -0
- package/dist/src/merge-options.js.map +1 -0
- package/dist/src/private-ip.d.ts.map +1 -1
- package/dist/src/private-ip.js +12 -6
- package/dist/src/private-ip.js.map +1 -1
- package/dist/src/queue/index.d.ts +9 -9
- package/dist/src/queue/index.d.ts.map +1 -1
- package/dist/src/repeating-task.d.ts +1 -1
- package/dist/src/repeating-task.d.ts.map +1 -1
- package/dist/src/repeating-task.js +1 -3
- package/dist/src/repeating-task.js.map +1 -1
- package/dist/src/stream-to-ma-conn.js.map +1 -1
- package/dist/typedoc-urls.json +96 -94
- package/package.json +20 -22
- package/src/abstract-stream.ts +11 -10
- package/src/adaptive-timeout.ts +2 -1
- package/src/debounce.ts +2 -2
- package/src/filters/cuckoo-filter.ts +2 -1
- package/src/filters/fingerprint.ts +1 -1
- package/src/filters/scalable-cuckoo-filter.ts +4 -2
- package/src/ip-port-to-multiaddr.ts +3 -2
- package/src/merge-options.ts +161 -0
- package/src/private-ip.ts +2 -6
- package/src/queue/index.ts +9 -9
- package/src/repeating-task.ts +6 -9
- package/src/stream-to-ma-conn.ts +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-to-ma-conn.js","sourceRoot":"","sources":["../../src/stream-to-ma-conn.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAsB9B;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAE,KAAuB;IAC3D,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IACrE,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAA;IAE1D,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,WAAW,GAAG,KAAK,CAAA;IAEvB,wEAAwE;IACxE,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,CAAC,KAAK,GAAG,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"stream-to-ma-conn.js","sourceRoot":"","sources":["../../src/stream-to-ma-conn.ts"],"names":[],"mappings":"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"}
|
package/dist/typedoc-urls.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
"createTimeoutOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
3
|
-
"./abort-options:createTimeoutOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
4
|
-
"AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
5
|
-
"./abstract-stream:AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
6
|
-
"AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
7
|
-
"./abstract-stream:AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
8
|
-
"AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
9
|
-
"./adaptive-timeout:AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
10
|
-
"AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
11
|
-
"./adaptive-timeout:AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
12
|
-
"AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
13
|
-
"./adaptive-timeout:AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
14
|
-
"GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
15
|
-
"./adaptive-timeout:GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
16
|
-
"DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.
|
|
17
|
-
"./adaptive-timeout:DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.
|
|
18
|
-
"DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.
|
|
19
|
-
"./adaptive-timeout:DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.
|
|
20
|
-
"DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.
|
|
21
|
-
"./adaptive-timeout:DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.
|
|
22
|
-
"arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
23
|
-
"./array-equals:arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
2
|
+
"createTimeoutOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.abort-options.createTimeoutOptions.html",
|
|
3
|
+
"./abort-options:createTimeoutOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.abort-options.createTimeoutOptions.html",
|
|
4
|
+
"AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.abstract-stream.AbstractStream.html",
|
|
5
|
+
"./abstract-stream:AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.abstract-stream.AbstractStream.html",
|
|
6
|
+
"AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.abstract-stream.AbstractStreamInit.html",
|
|
7
|
+
"./abstract-stream:AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.abstract-stream.AbstractStreamInit.html",
|
|
8
|
+
"AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.adaptive-timeout.AdaptiveTimeout.html",
|
|
9
|
+
"./adaptive-timeout:AdaptiveTimeout": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.adaptive-timeout.AdaptiveTimeout.html",
|
|
10
|
+
"AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive-timeout.AdaptiveTimeoutInit.html",
|
|
11
|
+
"./adaptive-timeout:AdaptiveTimeoutInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive-timeout.AdaptiveTimeoutInit.html",
|
|
12
|
+
"AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive-timeout.AdaptiveTimeoutSignal.html",
|
|
13
|
+
"./adaptive-timeout:AdaptiveTimeoutSignal": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive-timeout.AdaptiveTimeoutSignal.html",
|
|
14
|
+
"GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive-timeout.GetTimeoutSignalOptions.html",
|
|
15
|
+
"./adaptive-timeout:GetTimeoutSignalOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.adaptive-timeout.GetTimeoutSignalOptions.html",
|
|
16
|
+
"DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive-timeout.DEFAULT_FAILURE_MULTIPLIER.html",
|
|
17
|
+
"./adaptive-timeout:DEFAULT_FAILURE_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive-timeout.DEFAULT_FAILURE_MULTIPLIER.html",
|
|
18
|
+
"DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive-timeout.DEFAULT_MIN_TIMEOUT.html",
|
|
19
|
+
"./adaptive-timeout:DEFAULT_MIN_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive-timeout.DEFAULT_MIN_TIMEOUT.html",
|
|
20
|
+
"DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive-timeout.DEFAULT_TIMEOUT_MULTIPLIER.html",
|
|
21
|
+
"./adaptive-timeout:DEFAULT_TIMEOUT_MULTIPLIER": "https://libp2p.github.io/js-libp2p/variables/_libp2p_utils.adaptive-timeout.DEFAULT_TIMEOUT_MULTIPLIER.html",
|
|
22
|
+
"arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.array-equals.arrayEquals.html",
|
|
23
|
+
"./array-equals:arrayEquals": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.array-equals.arrayEquals.html",
|
|
24
24
|
"SafelyCloseConnectionOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.close.SafelyCloseConnectionOptions.html",
|
|
25
25
|
"./close:SafelyCloseConnectionOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.close.SafelyCloseConnectionOptions.html",
|
|
26
26
|
"safelyCloseConnectionIfUnused": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseConnectionIfUnused.html",
|
|
27
27
|
"./close:safelyCloseConnectionIfUnused": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseConnectionIfUnused.html",
|
|
28
28
|
"safelyCloseStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseStream.html",
|
|
29
29
|
"./close:safelyCloseStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close.safelyCloseStream.html",
|
|
30
|
-
"closeSource": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
31
|
-
"./close-source:closeSource": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
30
|
+
"closeSource": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close-source.closeSource.html",
|
|
31
|
+
"./close-source:closeSource": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.close-source.closeSource.html",
|
|
32
32
|
"DebouncedFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.debounce.DebouncedFunction.html",
|
|
33
33
|
"./debounce:DebouncedFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.debounce.DebouncedFunction.html",
|
|
34
34
|
"debounce": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.debounce.debounce.html",
|
|
@@ -47,44 +47,46 @@
|
|
|
47
47
|
"createBloomFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.filters.createBloomFilter.html",
|
|
48
48
|
"createCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.filters.createCuckooFilter.html",
|
|
49
49
|
"createScalableCuckooFilter": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.filters.createScalableCuckooFilter.html",
|
|
50
|
-
"getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
51
|
-
"./get-thin-waist-addresses:getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
52
|
-
"isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
53
|
-
"./global-unicast-ip:isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
54
|
-
"ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
55
|
-
"./ip-port-to-multiaddr:ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
56
|
-
"isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
57
|
-
"./is-async-generator:isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
58
|
-
"isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
59
|
-
"./is-generator:isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
60
|
-
"isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
61
|
-
"./is-promise:isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
62
|
-
"isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
63
|
-
"./link-local-ip:isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
64
|
-
"
|
|
65
|
-
"./
|
|
66
|
-
"
|
|
67
|
-
"./
|
|
68
|
-
"
|
|
69
|
-
"./multiaddr/is-
|
|
70
|
-
"
|
|
71
|
-
"./multiaddr/is-
|
|
72
|
-
"
|
|
73
|
-
"./multiaddr/is-
|
|
74
|
-
"
|
|
75
|
-
"./multiaddr/is-
|
|
76
|
-
"
|
|
77
|
-
"./multiaddr/is-
|
|
78
|
-
"
|
|
79
|
-
"./
|
|
80
|
-
"
|
|
81
|
-
"./peer-queue:
|
|
82
|
-
"
|
|
83
|
-
"./
|
|
84
|
-
"
|
|
85
|
-
"./priority-queue:
|
|
86
|
-
"
|
|
87
|
-
"./
|
|
50
|
+
"getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.get-thin-waist-addresses.getThinWaistAddresses.html",
|
|
51
|
+
"./get-thin-waist-addresses:getThinWaistAddresses": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.get-thin-waist-addresses.getThinWaistAddresses.html",
|
|
52
|
+
"isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.global-unicast-ip.isGlobalUnicastIp.html",
|
|
53
|
+
"./global-unicast-ip:isGlobalUnicastIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.global-unicast-ip.isGlobalUnicastIp.html",
|
|
54
|
+
"ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ip-port-to-multiaddr.ipPortToMultiaddr.html",
|
|
55
|
+
"./ip-port-to-multiaddr:ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.ip-port-to-multiaddr.ipPortToMultiaddr.html",
|
|
56
|
+
"isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is-async-generator.isAsyncGenerator.html",
|
|
57
|
+
"./is-async-generator:isAsyncGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is-async-generator.isAsyncGenerator.html",
|
|
58
|
+
"isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is-generator.isGenerator.html",
|
|
59
|
+
"./is-generator:isGenerator": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is-generator.isGenerator.html",
|
|
60
|
+
"isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is-promise.isPromise.html",
|
|
61
|
+
"./is-promise:isPromise": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.is-promise.isPromise.html",
|
|
62
|
+
"isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.link-local-ip.isLinkLocalIp.html",
|
|
63
|
+
"./link-local-ip:isLinkLocalIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.link-local-ip.isLinkLocalIp.html",
|
|
64
|
+
"mergeOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.merge-options.mergeOptions.html",
|
|
65
|
+
"./merge-options:mergeOptions": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.merge-options.mergeOptions.html",
|
|
66
|
+
"MovingAverage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.moving-average.MovingAverage.html",
|
|
67
|
+
"./moving-average:MovingAverage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.moving-average.MovingAverage.html",
|
|
68
|
+
"isGlobalUnicast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-global-unicast.isGlobalUnicast.html",
|
|
69
|
+
"./multiaddr/is-global-unicast:isGlobalUnicast": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-global-unicast.isGlobalUnicast.html",
|
|
70
|
+
"isIpBased": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-ip-based.isIpBased.html",
|
|
71
|
+
"./multiaddr/is-ip-based:isIpBased": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-ip-based.isIpBased.html",
|
|
72
|
+
"isLinkLocal": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-link-local.isLinkLocal.html",
|
|
73
|
+
"./multiaddr/is-link-local:isLinkLocal": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-link-local.isLinkLocal.html",
|
|
74
|
+
"isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-loopback.isLoopback.html",
|
|
75
|
+
"./multiaddr/is-loopback:isLoopback": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-loopback.isLoopback.html",
|
|
76
|
+
"isNetworkAddress": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-network-address.isNetworkAddress.html",
|
|
77
|
+
"./multiaddr/is-network-address:isNetworkAddress": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-network-address.isNetworkAddress.html",
|
|
78
|
+
"isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-private.isPrivate.html",
|
|
79
|
+
"./multiaddr/is-private:isPrivate": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.multiaddr_is-private.isPrivate.html",
|
|
80
|
+
"PeerQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.peer-queue.PeerQueue.html",
|
|
81
|
+
"./peer-queue:PeerQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.peer-queue.PeerQueue.html",
|
|
82
|
+
"PeerQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.peer-queue.PeerQueueJobOptions.html",
|
|
83
|
+
"./peer-queue:PeerQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.peer-queue.PeerQueueJobOptions.html",
|
|
84
|
+
"PriorityQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.priority-queue.PriorityQueue.html",
|
|
85
|
+
"./priority-queue:PriorityQueue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.priority-queue.PriorityQueue.html",
|
|
86
|
+
"PriorityQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.priority-queue.PriorityQueueJobOptions.html",
|
|
87
|
+
"./priority-queue:PriorityQueueJobOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.priority-queue.PriorityQueueJobOptions.html",
|
|
88
|
+
"isPrivateIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.private-ip.isPrivateIp.html",
|
|
89
|
+
"./private-ip:isPrivateIp": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.private-ip.isPrivateIp.html",
|
|
88
90
|
"Job": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.queue.Job.html",
|
|
89
91
|
"JobRecipient": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.queue.JobRecipient.html",
|
|
90
92
|
"Queue": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.queue.Queue.html",
|
|
@@ -106,36 +108,36 @@
|
|
|
106
108
|
"./queue:RunFunction": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.queue.RunFunction.html",
|
|
107
109
|
"JobStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.queue.JobStatus.html",
|
|
108
110
|
"./queue:JobStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_utils.queue.JobStatus.html",
|
|
109
|
-
"MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
110
|
-
"./rate-limiter:MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
111
|
-
"RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
112
|
-
"./rate-limiter:RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.
|
|
113
|
-
"GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
114
|
-
"./rate-limiter:GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
115
|
-
"RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
116
|
-
"./rate-limiter:RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
117
|
-
"RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
118
|
-
"./rate-limiter:RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
119
|
-
"RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
120
|
-
"./rate-limiter:RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
121
|
-
"RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
122
|
-
"./repeating-task:RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
123
|
-
"RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
124
|
-
"./repeating-task:RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
125
|
-
"repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
126
|
-
"./repeating-task:repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
127
|
-
"StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
128
|
-
"./stream-to-ma-conn:StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
129
|
-
"streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
130
|
-
"./stream-to-ma-conn:streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
131
|
-
"CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
132
|
-
"./tracked-list:CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
133
|
-
"trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
134
|
-
"./tracked-list:trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
135
|
-
"CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
136
|
-
"./tracked-map:CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
137
|
-
"TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
138
|
-
"./tracked-map:TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.
|
|
139
|
-
"trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
140
|
-
"./tracked-map:trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.
|
|
111
|
+
"MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate-limiter.MemoryStorage.html",
|
|
112
|
+
"./rate-limiter:MemoryStorage": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate-limiter.MemoryStorage.html",
|
|
113
|
+
"RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate-limiter.RateLimiter.html",
|
|
114
|
+
"./rate-limiter:RateLimiter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_utils.rate-limiter.RateLimiter.html",
|
|
115
|
+
"GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.GetKeySecDurationOptions.html",
|
|
116
|
+
"./rate-limiter:GetKeySecDurationOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.GetKeySecDurationOptions.html",
|
|
117
|
+
"RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.RateLimiterInit.html",
|
|
118
|
+
"./rate-limiter:RateLimiterInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.RateLimiterInit.html",
|
|
119
|
+
"RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.RateLimiterResult.html",
|
|
120
|
+
"./rate-limiter:RateLimiterResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.RateLimiterResult.html",
|
|
121
|
+
"RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.RateRecord.html",
|
|
122
|
+
"./rate-limiter:RateRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.rate-limiter.RateRecord.html",
|
|
123
|
+
"RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating-task.RepeatingTask.html",
|
|
124
|
+
"./repeating-task:RepeatingTask": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating-task.RepeatingTask.html",
|
|
125
|
+
"RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating-task.RepeatingTaskOptions.html",
|
|
126
|
+
"./repeating-task:RepeatingTaskOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.repeating-task.RepeatingTaskOptions.html",
|
|
127
|
+
"repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.repeating-task.repeatingTask.html",
|
|
128
|
+
"./repeating-task:repeatingTask": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.repeating-task.repeatingTask.html",
|
|
129
|
+
"StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.stream-to-ma-conn.StreamProperties.html",
|
|
130
|
+
"./stream-to-ma-conn:StreamProperties": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.stream-to-ma-conn.StreamProperties.html",
|
|
131
|
+
"streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.stream-to-ma-conn.streamToMaConnection.html",
|
|
132
|
+
"./stream-to-ma-conn:streamToMaConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.stream-to-ma-conn.streamToMaConnection.html",
|
|
133
|
+
"CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked-list.CreateTrackedListInit.html",
|
|
134
|
+
"./tracked-list:CreateTrackedListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked-list.CreateTrackedListInit.html",
|
|
135
|
+
"trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked-list.trackedList.html",
|
|
136
|
+
"./tracked-list:trackedList": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked-list.trackedList.html",
|
|
137
|
+
"CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked-map.CreateTrackedMapInit.html",
|
|
138
|
+
"./tracked-map:CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked-map.CreateTrackedMapInit.html",
|
|
139
|
+
"TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked-map.TrackedMapInit.html",
|
|
140
|
+
"./tracked-map:TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_utils.tracked-map.TrackedMapInit.html",
|
|
141
|
+
"trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked-map.trackedMap.html",
|
|
142
|
+
"./tracked-map:trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tracked-map.trackedMap.html"
|
|
141
143
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/utils",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.4",
|
|
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",
|
|
@@ -105,6 +105,10 @@
|
|
|
105
105
|
"types": "./dist/src/link-local-ip.d.ts",
|
|
106
106
|
"import": "./dist/src/link-local-ip.js"
|
|
107
107
|
},
|
|
108
|
+
"./merge-options": {
|
|
109
|
+
"types": "./dist/src/merge-options.d.ts",
|
|
110
|
+
"import": "./dist/src/merge-options.js"
|
|
111
|
+
},
|
|
108
112
|
"./moving-average": {
|
|
109
113
|
"types": "./dist/src/moving-average.d.ts",
|
|
110
114
|
"import": "./dist/src/moving-average.js"
|
|
@@ -170,13 +174,6 @@
|
|
|
170
174
|
"import": "./dist/src/tracked-map.js"
|
|
171
175
|
}
|
|
172
176
|
},
|
|
173
|
-
"eslintConfig": {
|
|
174
|
-
"extends": "ipfs",
|
|
175
|
-
"parserOptions": {
|
|
176
|
-
"project": true,
|
|
177
|
-
"sourceType": "module"
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
177
|
"scripts": {
|
|
181
178
|
"clean": "aegir clean",
|
|
182
179
|
"lint": "aegir lint",
|
|
@@ -192,46 +189,47 @@
|
|
|
192
189
|
"test:electron-main": "aegir test -t electron-main"
|
|
193
190
|
},
|
|
194
191
|
"dependencies": {
|
|
195
|
-
"@chainsafe/is-ip": "^2.0
|
|
192
|
+
"@chainsafe/is-ip": "^2.1.0",
|
|
196
193
|
"@chainsafe/netmask": "^2.0.0",
|
|
197
|
-
"@libp2p/crypto": "^5.1.
|
|
198
|
-
"@libp2p/interface": "^2.10.
|
|
199
|
-
"@libp2p/logger": "^5.1.
|
|
200
|
-
"@multiformats/multiaddr": "^12.
|
|
194
|
+
"@libp2p/crypto": "^5.1.3",
|
|
195
|
+
"@libp2p/interface": "^2.10.1",
|
|
196
|
+
"@libp2p/logger": "^5.1.17",
|
|
197
|
+
"@multiformats/multiaddr": "^12.4.0",
|
|
201
198
|
"@sindresorhus/fnv1a": "^3.1.0",
|
|
202
199
|
"any-signal": "^4.1.1",
|
|
203
200
|
"delay": "^6.0.0",
|
|
204
201
|
"get-iterator": "^2.0.1",
|
|
205
202
|
"is-loopback-addr": "^2.0.2",
|
|
206
|
-
"
|
|
203
|
+
"is-plain-obj": "^4.1.0",
|
|
204
|
+
"it-foreach": "^2.1.3",
|
|
207
205
|
"it-pipe": "^3.0.1",
|
|
208
206
|
"it-pushable": "^3.2.3",
|
|
209
207
|
"it-stream-types": "^2.0.2",
|
|
210
208
|
"netmask": "^2.0.2",
|
|
211
209
|
"p-defer": "^4.0.1",
|
|
212
210
|
"race-event": "^1.3.0",
|
|
213
|
-
"race-signal": "^1.1.
|
|
211
|
+
"race-signal": "^1.1.3",
|
|
214
212
|
"uint8arraylist": "^2.4.8",
|
|
215
213
|
"uint8arrays": "^5.1.0"
|
|
216
214
|
},
|
|
217
215
|
"devDependencies": {
|
|
218
|
-
"@libp2p/peer-id": "^5.1.
|
|
216
|
+
"@libp2p/peer-id": "^5.1.4",
|
|
219
217
|
"@types/netmask": "^2.0.5",
|
|
220
|
-
"aegir": "^
|
|
218
|
+
"aegir": "^47.0.6",
|
|
221
219
|
"benchmark": "^2.1.4",
|
|
222
220
|
"delay": "^6.0.0",
|
|
223
|
-
"it-all": "^3.0.
|
|
224
|
-
"it-drain": "^3.0.
|
|
221
|
+
"it-all": "^3.0.8",
|
|
222
|
+
"it-drain": "^3.0.9",
|
|
225
223
|
"it-pair": "^2.0.6",
|
|
226
|
-
"sinon": "^
|
|
224
|
+
"sinon": "^20.0.0",
|
|
227
225
|
"sinon-ts": "^2.0.0",
|
|
228
226
|
"wherearewe": "^2.0.1"
|
|
229
227
|
},
|
|
230
|
-
"sideEffects": false,
|
|
231
228
|
"browser": {
|
|
232
229
|
"./dist/src/get-thin-waist-addresses.js": "./dist/src/get-thin-waist-addresses.browser.js"
|
|
233
230
|
},
|
|
234
231
|
"react-native": {
|
|
235
232
|
"./dist/src/get-thin-waist-addresses.js": "./dist/src/get-thin-waist-addresses.js"
|
|
236
|
-
}
|
|
233
|
+
},
|
|
234
|
+
"sideEffects": false
|
|
237
235
|
}
|
package/src/abstract-stream.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { StreamResetError, StreamStateError } from '@libp2p/interface'
|
|
2
|
-
import {
|
|
3
|
-
import defer
|
|
4
|
-
import pDefer from 'p-defer'
|
|
2
|
+
import { pushable } from 'it-pushable'
|
|
3
|
+
import defer from 'p-defer'
|
|
5
4
|
import { raceSignal } from 'race-signal'
|
|
6
5
|
import { Uint8ArrayList } from 'uint8arraylist'
|
|
7
6
|
import { closeSource } from './close-source.js'
|
|
8
7
|
import type { AbortOptions, Direction, ReadStatus, Stream, StreamStatus, StreamTimeline, WriteStatus } from '@libp2p/interface'
|
|
9
8
|
import type { Logger } from '@libp2p/logger'
|
|
9
|
+
import type { Pushable } from 'it-pushable'
|
|
10
10
|
import type { Source } from 'it-stream-types'
|
|
11
|
+
import type { DeferredPromise } from 'p-defer'
|
|
11
12
|
|
|
12
13
|
const DEFAULT_SEND_CLOSE_WRITE_TIMEOUT = 5000
|
|
13
14
|
|
|
@@ -35,7 +36,7 @@ export interface AbstractStreamInit {
|
|
|
35
36
|
/**
|
|
36
37
|
* Invoked when the stream ends
|
|
37
38
|
*/
|
|
38
|
-
onEnd?(err?: Error
|
|
39
|
+
onEnd?(err?: Error): void
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
42
|
* Invoked when the readable end of the stream is closed
|
|
@@ -99,7 +100,7 @@ export abstract class AbstractStream implements Stream {
|
|
|
99
100
|
private readonly closed: DeferredPromise<void>
|
|
100
101
|
private endErr: Error | undefined
|
|
101
102
|
private readonly streamSource: Pushable<Uint8ArrayList>
|
|
102
|
-
private readonly onEnd?: (err?: Error
|
|
103
|
+
private readonly onEnd?: (err?: Error) => void
|
|
103
104
|
private readonly onCloseRead?: () => void
|
|
104
105
|
private readonly onCloseWrite?: () => void
|
|
105
106
|
private readonly onReset?: () => void
|
|
@@ -127,10 +128,10 @@ export abstract class AbstractStream implements Stream {
|
|
|
127
128
|
this.sendCloseWriteTimeout = init.sendCloseWriteTimeout ?? DEFAULT_SEND_CLOSE_WRITE_TIMEOUT
|
|
128
129
|
|
|
129
130
|
this.onEnd = init.onEnd
|
|
130
|
-
this.onCloseRead = init
|
|
131
|
-
this.onCloseWrite = init
|
|
132
|
-
this.onReset = init
|
|
133
|
-
this.onAbort = init
|
|
131
|
+
this.onCloseRead = init.onCloseRead
|
|
132
|
+
this.onCloseWrite = init.onCloseWrite
|
|
133
|
+
this.onReset = init.onReset
|
|
134
|
+
this.onAbort = init.onAbort
|
|
134
135
|
|
|
135
136
|
this.source = this.streamSource = pushable<Uint8ArrayList>({
|
|
136
137
|
onEnd: (err) => {
|
|
@@ -183,7 +184,7 @@ export abstract class AbstractStream implements Stream {
|
|
|
183
184
|
const res = this.sendData(data, options)
|
|
184
185
|
|
|
185
186
|
if (isPromise(res)) {
|
|
186
|
-
this.sendingData =
|
|
187
|
+
this.sendingData = defer()
|
|
187
188
|
await res
|
|
188
189
|
this.sendingData.resolve()
|
|
189
190
|
this.sendingData = undefined
|
package/src/adaptive-timeout.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { setMaxListeners } from '@libp2p/interface'
|
|
2
|
-
import { anySignal
|
|
2
|
+
import { anySignal } from 'any-signal'
|
|
3
3
|
import { MovingAverage } from './moving-average.js'
|
|
4
4
|
import type { MetricGroup, Metrics } from '@libp2p/interface'
|
|
5
|
+
import type { ClearableSignal } from 'any-signal'
|
|
5
6
|
|
|
6
7
|
export const DEFAULT_TIMEOUT_MULTIPLIER = 1.2
|
|
7
8
|
export const DEFAULT_FAILURE_MULTIPLIER = 2
|
package/src/debounce.ts
CHANGED
|
@@ -21,8 +21,8 @@ export function debounce (func: () => void | Promise<void>, wait: number): Debou
|
|
|
21
21
|
clearTimeout(timeout)
|
|
22
22
|
timeout = setTimeout(later, wait)
|
|
23
23
|
}
|
|
24
|
-
output.start = () => {}
|
|
25
|
-
output.stop = () => {
|
|
24
|
+
output.start = (): void => {}
|
|
25
|
+
output.stop = (): void => {
|
|
26
26
|
clearTimeout(timeout)
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
2
2
|
import { Bucket } from './bucket.js'
|
|
3
3
|
import { Fingerprint, MAX_FINGERPRINT_SIZE } from './fingerprint.js'
|
|
4
|
-
import { fnv1a
|
|
4
|
+
import { fnv1a } from './hashes.js'
|
|
5
5
|
import { getRandomInt } from './utils.js'
|
|
6
|
+
import type { Hash } from './hashes.js'
|
|
6
7
|
import type { Filter } from './index.js'
|
|
7
8
|
|
|
8
9
|
const maxCuckooCount = 500
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
2
|
-
import { CuckooFilter, optimize
|
|
3
|
-
import { fnv1a
|
|
2
|
+
import { CuckooFilter, optimize } from './cuckoo-filter.js'
|
|
3
|
+
import { fnv1a } from './hashes.js'
|
|
4
4
|
import { getRandomInt } from './utils.js'
|
|
5
|
+
import type { CuckooFilterInit } from './cuckoo-filter.js'
|
|
6
|
+
import type { Hash } from './hashes.js'
|
|
5
7
|
import type { Filter } from './index.js'
|
|
6
8
|
|
|
7
9
|
export interface ScalableCuckooFilterInit extends CuckooFilterInit {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { isIPv4, isIPv6 } from '@chainsafe/is-ip'
|
|
2
2
|
import { InvalidParametersError } from '@libp2p/interface'
|
|
3
|
-
import {
|
|
3
|
+
import { multiaddr } from '@multiformats/multiaddr'
|
|
4
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Transform an IP, Port pair into a multiaddr
|
|
7
8
|
*/
|
|
8
9
|
export function ipPortToMultiaddr (ip: string, port: number | string): Multiaddr {
|
|
9
10
|
if (typeof ip !== 'string') {
|
|
10
|
-
throw new InvalidParametersError(`invalid ip provided: ${ip}`)
|
|
11
|
+
throw new InvalidParametersError(`invalid ip provided: ${ip}`)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
if (typeof port === 'string') {
|