@libp2p/utils 7.1.0 → 7.2.0-5692f3f16
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/index.min.js +4 -4
- package/dist/index.min.js.map +4 -4
- package/dist/src/multiaddr/index.d.ts +1 -0
- package/dist/src/multiaddr/index.d.ts.map +1 -1
- package/dist/src/multiaddr/index.js +1 -0
- package/dist/src/multiaddr/index.js.map +1 -1
- package/dist/src/multiaddr/sorters.d.ts +30 -0
- package/dist/src/multiaddr/sorters.d.ts.map +1 -0
- package/dist/src/multiaddr/sorters.js +119 -0
- package/dist/src/multiaddr/sorters.js.map +1 -0
- package/dist/src/queue/job.d.ts +1 -0
- package/dist/src/queue/job.d.ts.map +1 -1
- package/dist/src/queue/job.js +16 -3
- package/dist/src/queue/job.js.map +1 -1
- package/package.json +6 -5
- package/src/multiaddr/index.ts +1 -0
- package/src/multiaddr/sorters.ts +147 -0
- package/src/queue/job.ts +18 -3
- package/dist/typedoc-urls.json +0 -125
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiaddr/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiaddr/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiaddr/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiaddr/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
2
|
+
/**
|
|
3
|
+
* Sorts addresses by order of reliability, where they have presented the fewest
|
|
4
|
+
* problems:
|
|
5
|
+
*
|
|
6
|
+
* TCP -> WebSockets/Secure -> WebRTC -> WebRTCDirect -> WebTransport
|
|
7
|
+
*/
|
|
8
|
+
export declare function reliableTransportsFirst(a: Multiaddr, b: Multiaddr): -1 | 0 | 1;
|
|
9
|
+
/**
|
|
10
|
+
* Compare function for array.sort() that moves loopback addresses to the end
|
|
11
|
+
* of the array.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loopbackAddressLast(a: Multiaddr, b: Multiaddr): -1 | 0 | 1;
|
|
14
|
+
/**
|
|
15
|
+
* Compare function for array.sort() that moves public addresses to the start
|
|
16
|
+
* of the array.
|
|
17
|
+
*/
|
|
18
|
+
export declare function publicAddressesFirst(a: Multiaddr, b: Multiaddr): -1 | 0 | 1;
|
|
19
|
+
/**
|
|
20
|
+
* Compare function for array.sort() that moves circuit relay addresses to the
|
|
21
|
+
* end of the array.
|
|
22
|
+
*/
|
|
23
|
+
export declare function circuitRelayAddressesLast(a: Multiaddr, b: Multiaddr): -1 | 0 | 1;
|
|
24
|
+
/**
|
|
25
|
+
* Sort multiaddrs by the default multiaddr-only ordering: loopback addresses
|
|
26
|
+
* last, public addresses first, circuit-relay addresses last, with reliable
|
|
27
|
+
* transports as the innermost tiebreaker.
|
|
28
|
+
*/
|
|
29
|
+
export declare function defaultMultiaddrSorter(multiaddrs: Multiaddr[]): Multiaddr[];
|
|
30
|
+
//# sourceMappingURL=sorters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sorters.d.ts","sourceRoot":"","sources":["../../../src/multiaddr/sorters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAqE/E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAW3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAW5E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAWjF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAO5E"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Circuit, WebSockets, WebSocketsSecure, WebRTC, WebRTCDirect, WebTransport, TCP } from '@multiformats/multiaddr-matcher';
|
|
2
|
+
import { isLoopback } from "./is-loopback.js";
|
|
3
|
+
import { isPrivate } from "./is-private.js";
|
|
4
|
+
/**
|
|
5
|
+
* Sorts addresses by order of reliability, where they have presented the fewest
|
|
6
|
+
* problems:
|
|
7
|
+
*
|
|
8
|
+
* TCP -> WebSockets/Secure -> WebRTC -> WebRTCDirect -> WebTransport
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line complexity
|
|
11
|
+
export function reliableTransportsFirst(a, b) {
|
|
12
|
+
const isATcp = TCP.exactMatch(a);
|
|
13
|
+
const isBTcp = TCP.exactMatch(b);
|
|
14
|
+
if (isATcp && !isBTcp) {
|
|
15
|
+
return -1;
|
|
16
|
+
}
|
|
17
|
+
if (!isATcp && isBTcp) {
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
const isAWebSocketSecure = WebSocketsSecure.exactMatch(a);
|
|
21
|
+
const isBWebSocketSecure = WebSocketsSecure.exactMatch(b);
|
|
22
|
+
if (isAWebSocketSecure && !isBWebSocketSecure) {
|
|
23
|
+
return -1;
|
|
24
|
+
}
|
|
25
|
+
if (!isAWebSocketSecure && isBWebSocketSecure) {
|
|
26
|
+
return 1;
|
|
27
|
+
}
|
|
28
|
+
const isAWebSocket = WebSockets.exactMatch(a);
|
|
29
|
+
const isBWebSocket = WebSockets.exactMatch(b);
|
|
30
|
+
if (isAWebSocket && !isBWebSocket) {
|
|
31
|
+
return -1;
|
|
32
|
+
}
|
|
33
|
+
if (!isAWebSocket && isBWebSocket) {
|
|
34
|
+
return 1;
|
|
35
|
+
}
|
|
36
|
+
const isAWebRTC = WebRTC.exactMatch(a);
|
|
37
|
+
const isBWebRTC = WebRTC.exactMatch(b);
|
|
38
|
+
if (isAWebRTC && !isBWebRTC) {
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
if (!isAWebRTC && isBWebRTC) {
|
|
42
|
+
return 1;
|
|
43
|
+
}
|
|
44
|
+
const isAWebRTCDirect = WebRTCDirect.exactMatch(a);
|
|
45
|
+
const isBWebRTCDirect = WebRTCDirect.exactMatch(b);
|
|
46
|
+
if (isAWebRTCDirect && !isBWebRTCDirect) {
|
|
47
|
+
return -1;
|
|
48
|
+
}
|
|
49
|
+
if (!isAWebRTCDirect && isBWebRTCDirect) {
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
const isAWebTransport = WebTransport.exactMatch(a);
|
|
53
|
+
const isBWebTransport = WebTransport.exactMatch(b);
|
|
54
|
+
if (isAWebTransport && !isBWebTransport) {
|
|
55
|
+
return -1;
|
|
56
|
+
}
|
|
57
|
+
if (!isAWebTransport && isBWebTransport) {
|
|
58
|
+
return 1;
|
|
59
|
+
}
|
|
60
|
+
// ... everything else
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Compare function for array.sort() that moves loopback addresses to the end
|
|
65
|
+
* of the array.
|
|
66
|
+
*/
|
|
67
|
+
export function loopbackAddressLast(a, b) {
|
|
68
|
+
const isALoopback = isLoopback(a);
|
|
69
|
+
const isBLoopback = isLoopback(b);
|
|
70
|
+
if (isALoopback && !isBLoopback) {
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
73
|
+
else if (!isALoopback && isBLoopback) {
|
|
74
|
+
return -1;
|
|
75
|
+
}
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Compare function for array.sort() that moves public addresses to the start
|
|
80
|
+
* of the array.
|
|
81
|
+
*/
|
|
82
|
+
export function publicAddressesFirst(a, b) {
|
|
83
|
+
const isAPrivate = isPrivate(a);
|
|
84
|
+
const isBPrivate = isPrivate(b);
|
|
85
|
+
if (isAPrivate && !isBPrivate) {
|
|
86
|
+
return 1;
|
|
87
|
+
}
|
|
88
|
+
else if (!isAPrivate && isBPrivate) {
|
|
89
|
+
return -1;
|
|
90
|
+
}
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Compare function for array.sort() that moves circuit relay addresses to the
|
|
95
|
+
* end of the array.
|
|
96
|
+
*/
|
|
97
|
+
export function circuitRelayAddressesLast(a, b) {
|
|
98
|
+
const isACircuit = Circuit.exactMatch(a);
|
|
99
|
+
const isBCircuit = Circuit.exactMatch(b);
|
|
100
|
+
if (isACircuit && !isBCircuit) {
|
|
101
|
+
return 1;
|
|
102
|
+
}
|
|
103
|
+
else if (!isACircuit && isBCircuit) {
|
|
104
|
+
return -1;
|
|
105
|
+
}
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Sort multiaddrs by the default multiaddr-only ordering: loopback addresses
|
|
110
|
+
* last, public addresses first, circuit-relay addresses last, with reliable
|
|
111
|
+
* transports as the innermost tiebreaker.
|
|
112
|
+
*/
|
|
113
|
+
export function defaultMultiaddrSorter(multiaddrs) {
|
|
114
|
+
return multiaddrs.sort((a, b) => loopbackAddressLast(a, b) ||
|
|
115
|
+
publicAddressesFirst(a, b) ||
|
|
116
|
+
circuitRelayAddressesLast(a, b) ||
|
|
117
|
+
reliableTransportsFirst(a, b));
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=sorters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sorters.js","sourceRoot":"","sources":["../../../src/multiaddr/sorters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAA;AAChI,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C;;;;;GAKG;AACH,sCAAsC;AACtC,MAAM,UAAU,uBAAuB,CAAE,CAAY,EAAE,CAAY;IACjE,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IAChC,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IAE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,CAAA;IACX,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAE,CAAY,EAAE,CAAY;IACnE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACxC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IAExC,IAAI,UAAU,IAAI,CAAC,UAAU,EAAE,CAAC;QAC9B,OAAO,CAAC,CAAA;IACV,CAAC;SAAM,IAAI,CAAC,UAAU,IAAI,UAAU,EAAE,CAAC;QACrC,OAAO,CAAC,CAAC,CAAA;IACX,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAE,UAAuB;IAC7D,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC9B,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC;QACzB,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC1B,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/B,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAC9B,CAAA;AACH,CAAC"}
|
package/dist/src/queue/job.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare class Job<JobOptions extends AbortOptions & ProgressOptions = Abo
|
|
|
15
15
|
status: JobStatus;
|
|
16
16
|
readonly timeline: JobTimeline;
|
|
17
17
|
private readonly controller;
|
|
18
|
+
private dispatchingProgress;
|
|
18
19
|
constructor(fn: (options: JobOptions) => Promise<JobReturnType>, options: any);
|
|
19
20
|
abort(err: Error): void;
|
|
20
21
|
onAbort(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/queue/job.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA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AO;IAClG,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IACnD,OAAO,EAAE,UAAU,CAAA;IACnB,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAA;IAC9C,MAAM,EAAE,SAAS,CAAA;IACxB,SAAgB,QAAQ,EAAE,WAAW,CAAA;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiB;IAC5C,OAAO,CAAC,mBAAmB,CAAS;gBAEvB,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,GAAG;IAkB9E,KAAK,CAAE,GAAG,EAAE,KAAK,GAAG,IAAI;IAIxB,OAAO,IAAK,IAAI;IAYV,IAAI,CAAE,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAS3F,GAAG,IAAK,OAAO,CAAC,IAAI,CAAC;IA8C3B,OAAO,IAAK,IAAI;CAMjB"}
|
package/dist/src/queue/job.js
CHANGED
|
@@ -16,6 +16,7 @@ export class Job {
|
|
|
16
16
|
status;
|
|
17
17
|
timeline;
|
|
18
18
|
controller;
|
|
19
|
+
dispatchingProgress;
|
|
19
20
|
constructor(fn, options) {
|
|
20
21
|
this.id = randomId();
|
|
21
22
|
this.status = 'queued';
|
|
@@ -27,6 +28,7 @@ export class Job {
|
|
|
27
28
|
};
|
|
28
29
|
this.controller = new AbortController();
|
|
29
30
|
setMaxListeners(Infinity, this.controller.signal);
|
|
31
|
+
this.dispatchingProgress = false;
|
|
30
32
|
this.onAbort = this.onAbort.bind(this);
|
|
31
33
|
}
|
|
32
34
|
abort(err) {
|
|
@@ -57,9 +59,20 @@ export class Job {
|
|
|
57
59
|
...(this.options ?? {}),
|
|
58
60
|
signal: this.controller.signal,
|
|
59
61
|
onProgress: (evt) => {
|
|
60
|
-
this
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
// Recipients can transitively re-enter this dispatcher; without
|
|
63
|
+
// this guard a single event recurses until the stack overflows.
|
|
64
|
+
if (this.dispatchingProgress) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.dispatchingProgress = true;
|
|
68
|
+
try {
|
|
69
|
+
this.recipients.forEach(recipient => {
|
|
70
|
+
recipient.onProgress?.(evt);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
this.dispatchingProgress = false;
|
|
75
|
+
}
|
|
63
76
|
}
|
|
64
77
|
}), this.controller.signal);
|
|
65
78
|
this.recipients.forEach(recipient => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../src/queue/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAK7C;;GAEG;AACH,SAAS,QAAQ;IACf,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;AACjF,CAAC;AAQD,MAAM,OAAO,GAAG;IACP,EAAE,CAAQ;IACV,EAAE,CAAiD;IACnD,OAAO,CAAY;IACnB,UAAU,CAAoC;IAC9C,MAAM,CAAW;IACR,QAAQ,CAAa;IACpB,UAAU,CAAiB;
|
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../src/queue/job.ts"],"names":[],"mappings":"AAAA,O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J,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/utils",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-5692f3f16",
|
|
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",
|
|
@@ -47,10 +47,11 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@chainsafe/is-ip": "^2.1.0",
|
|
49
49
|
"@chainsafe/netmask": "^2.0.0",
|
|
50
|
-
"@libp2p/crypto": "
|
|
51
|
-
"@libp2p/interface": "
|
|
52
|
-
"@libp2p/logger": "
|
|
50
|
+
"@libp2p/crypto": "5.1.18-5692f3f16",
|
|
51
|
+
"@libp2p/interface": "3.2.2-5692f3f16",
|
|
52
|
+
"@libp2p/logger": "6.2.7-5692f3f16",
|
|
53
53
|
"@multiformats/multiaddr": "^13.0.1",
|
|
54
|
+
"@multiformats/multiaddr-matcher": "^3.0.1",
|
|
54
55
|
"@sindresorhus/fnv1a": "^3.1.0",
|
|
55
56
|
"any-signal": "^4.1.1",
|
|
56
57
|
"cborg": "^5.1.0",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"uint8arrays": "^5.1.0"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
|
-
"@libp2p/peer-id": "
|
|
75
|
+
"@libp2p/peer-id": "6.0.9-5692f3f16",
|
|
75
76
|
"@types/netmask": "^2.0.5",
|
|
76
77
|
"aegir": "^47.0.22",
|
|
77
78
|
"benchmark": "^2.1.4",
|
package/src/multiaddr/index.ts
CHANGED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Circuit, WebSockets, WebSocketsSecure, WebRTC, WebRTCDirect, WebTransport, TCP } from '@multiformats/multiaddr-matcher'
|
|
2
|
+
import { isLoopback } from './is-loopback.ts'
|
|
3
|
+
import { isPrivate } from './is-private.ts'
|
|
4
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Sorts addresses by order of reliability, where they have presented the fewest
|
|
8
|
+
* problems:
|
|
9
|
+
*
|
|
10
|
+
* TCP -> WebSockets/Secure -> WebRTC -> WebRTCDirect -> WebTransport
|
|
11
|
+
*/
|
|
12
|
+
// eslint-disable-next-line complexity
|
|
13
|
+
export function reliableTransportsFirst (a: Multiaddr, b: Multiaddr): -1 | 0 | 1 {
|
|
14
|
+
const isATcp = TCP.exactMatch(a)
|
|
15
|
+
const isBTcp = TCP.exactMatch(b)
|
|
16
|
+
|
|
17
|
+
if (isATcp && !isBTcp) {
|
|
18
|
+
return -1
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!isATcp && isBTcp) {
|
|
22
|
+
return 1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const isAWebSocketSecure = WebSocketsSecure.exactMatch(a)
|
|
26
|
+
const isBWebSocketSecure = WebSocketsSecure.exactMatch(b)
|
|
27
|
+
|
|
28
|
+
if (isAWebSocketSecure && !isBWebSocketSecure) {
|
|
29
|
+
return -1
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!isAWebSocketSecure && isBWebSocketSecure) {
|
|
33
|
+
return 1
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isAWebSocket = WebSockets.exactMatch(a)
|
|
37
|
+
const isBWebSocket = WebSockets.exactMatch(b)
|
|
38
|
+
|
|
39
|
+
if (isAWebSocket && !isBWebSocket) {
|
|
40
|
+
return -1
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!isAWebSocket && isBWebSocket) {
|
|
44
|
+
return 1
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const isAWebRTC = WebRTC.exactMatch(a)
|
|
48
|
+
const isBWebRTC = WebRTC.exactMatch(b)
|
|
49
|
+
|
|
50
|
+
if (isAWebRTC && !isBWebRTC) {
|
|
51
|
+
return -1
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!isAWebRTC && isBWebRTC) {
|
|
55
|
+
return 1
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const isAWebRTCDirect = WebRTCDirect.exactMatch(a)
|
|
59
|
+
const isBWebRTCDirect = WebRTCDirect.exactMatch(b)
|
|
60
|
+
|
|
61
|
+
if (isAWebRTCDirect && !isBWebRTCDirect) {
|
|
62
|
+
return -1
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!isAWebRTCDirect && isBWebRTCDirect) {
|
|
66
|
+
return 1
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const isAWebTransport = WebTransport.exactMatch(a)
|
|
70
|
+
const isBWebTransport = WebTransport.exactMatch(b)
|
|
71
|
+
|
|
72
|
+
if (isAWebTransport && !isBWebTransport) {
|
|
73
|
+
return -1
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!isAWebTransport && isBWebTransport) {
|
|
77
|
+
return 1
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ... everything else
|
|
81
|
+
return 0
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Compare function for array.sort() that moves loopback addresses to the end
|
|
86
|
+
* of the array.
|
|
87
|
+
*/
|
|
88
|
+
export function loopbackAddressLast (a: Multiaddr, b: Multiaddr): -1 | 0 | 1 {
|
|
89
|
+
const isALoopback = isLoopback(a)
|
|
90
|
+
const isBLoopback = isLoopback(b)
|
|
91
|
+
|
|
92
|
+
if (isALoopback && !isBLoopback) {
|
|
93
|
+
return 1
|
|
94
|
+
} else if (!isALoopback && isBLoopback) {
|
|
95
|
+
return -1
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return 0
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Compare function for array.sort() that moves public addresses to the start
|
|
103
|
+
* of the array.
|
|
104
|
+
*/
|
|
105
|
+
export function publicAddressesFirst (a: Multiaddr, b: Multiaddr): -1 | 0 | 1 {
|
|
106
|
+
const isAPrivate = isPrivate(a)
|
|
107
|
+
const isBPrivate = isPrivate(b)
|
|
108
|
+
|
|
109
|
+
if (isAPrivate && !isBPrivate) {
|
|
110
|
+
return 1
|
|
111
|
+
} else if (!isAPrivate && isBPrivate) {
|
|
112
|
+
return -1
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return 0
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Compare function for array.sort() that moves circuit relay addresses to the
|
|
120
|
+
* end of the array.
|
|
121
|
+
*/
|
|
122
|
+
export function circuitRelayAddressesLast (a: Multiaddr, b: Multiaddr): -1 | 0 | 1 {
|
|
123
|
+
const isACircuit = Circuit.exactMatch(a)
|
|
124
|
+
const isBCircuit = Circuit.exactMatch(b)
|
|
125
|
+
|
|
126
|
+
if (isACircuit && !isBCircuit) {
|
|
127
|
+
return 1
|
|
128
|
+
} else if (!isACircuit && isBCircuit) {
|
|
129
|
+
return -1
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return 0
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Sort multiaddrs by the default multiaddr-only ordering: loopback addresses
|
|
137
|
+
* last, public addresses first, circuit-relay addresses last, with reliable
|
|
138
|
+
* transports as the innermost tiebreaker.
|
|
139
|
+
*/
|
|
140
|
+
export function defaultMultiaddrSorter (multiaddrs: Multiaddr[]): Multiaddr[] {
|
|
141
|
+
return multiaddrs.sort((a, b) =>
|
|
142
|
+
loopbackAddressLast(a, b) ||
|
|
143
|
+
publicAddressesFirst(a, b) ||
|
|
144
|
+
circuitRelayAddressesLast(a, b) ||
|
|
145
|
+
reliableTransportsFirst(a, b)
|
|
146
|
+
)
|
|
147
|
+
}
|
package/src/queue/job.ts
CHANGED
|
@@ -27,6 +27,7 @@ export class Job <JobOptions extends AbortOptions & ProgressOptions = AbortOptio
|
|
|
27
27
|
public status: JobStatus
|
|
28
28
|
public readonly timeline: JobTimeline
|
|
29
29
|
private readonly controller: AbortController
|
|
30
|
+
private dispatchingProgress: boolean
|
|
30
31
|
|
|
31
32
|
constructor (fn: (options: JobOptions) => Promise<JobReturnType>, options: any) {
|
|
32
33
|
this.id = randomId()
|
|
@@ -41,6 +42,8 @@ export class Job <JobOptions extends AbortOptions & ProgressOptions = AbortOptio
|
|
|
41
42
|
this.controller = new AbortController()
|
|
42
43
|
setMaxListeners(Infinity, this.controller.signal)
|
|
43
44
|
|
|
45
|
+
this.dispatchingProgress = false
|
|
46
|
+
|
|
44
47
|
this.onAbort = this.onAbort.bind(this)
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -80,9 +83,21 @@ export class Job <JobOptions extends AbortOptions & ProgressOptions = AbortOptio
|
|
|
80
83
|
...(this.options ?? {}),
|
|
81
84
|
signal: this.controller.signal,
|
|
82
85
|
onProgress: (evt: any): void => {
|
|
83
|
-
this
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
// Recipients can transitively re-enter this dispatcher; without
|
|
87
|
+
// this guard a single event recurses until the stack overflows.
|
|
88
|
+
if (this.dispatchingProgress) {
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
this.dispatchingProgress = true
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
this.recipients.forEach(recipient => {
|
|
96
|
+
recipient.onProgress?.(evt)
|
|
97
|
+
})
|
|
98
|
+
} finally {
|
|
99
|
+
this.dispatchingProgress = false
|
|
100
|
+
}
|
|
86
101
|
}
|
|
87
102
|
}), this.controller.signal)
|
|
88
103
|
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
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
|
-
"tryGetNetConfig": "https://libp2p.github.io/js-libp2p/functions/_libp2p_utils.tryGetNetConfig.html"
|
|
125
|
-
}
|