@constl/utils-tests 1.6.6 → 1.6.8
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/attente.d.ts +1 -0
- package/dist/attente.js +15 -0
- package/dist/attente.js.map +1 -1
- package/dist/libp2p.d.ts +11 -0
- package/dist/libp2p.js +10 -0
- package/dist/libp2p.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/attente.ts +17 -0
- package/src/libp2p.ts +19 -0
- package/src/version.ts +1 -1
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.6.
|
|
1
|
+
export declare const version = "1.6.8";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/src/attente.ts
CHANGED
|
@@ -40,6 +40,23 @@ export class AttendreRésultat<T> {
|
|
|
40
40
|
return val;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async attendreNexistePas(): Promise<void> {
|
|
44
|
+
if (this.val === undefined) return;
|
|
45
|
+
|
|
46
|
+
const id = uuidv4();
|
|
47
|
+
|
|
48
|
+
return new Promise((résoudre) => {
|
|
49
|
+
const fLorsqueChangé = async () => {
|
|
50
|
+
if (this.val === undefined) {
|
|
51
|
+
this.oublier(id);
|
|
52
|
+
résoudre();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
this.événements.on("changé", fLorsqueChangé);
|
|
56
|
+
this.fsOublier[id] = () => this.événements.off("changé", fLorsqueChangé);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
43
60
|
oublier(id: string) {
|
|
44
61
|
this.fsOublier[id]();
|
|
45
62
|
delete this.fsOublier[id];
|
package/src/libp2p.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { noise } from "@chainsafe/libp2p-noise";
|
|
|
32
32
|
import { yamux } from "@chainsafe/libp2p-yamux";
|
|
33
33
|
import { gossipsub } from "@chainsafe/libp2p-gossipsub";
|
|
34
34
|
import { circuitRelayTransport } from "@libp2p/circuit-relay-v2";
|
|
35
|
+
import type { PrivateKey } from "@libp2p/interface";
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* A basic Libp2p configuration for Node.js nodes.
|
|
@@ -80,5 +81,23 @@ export const DefaultLibp2pBrowserOptions = {
|
|
|
80
81
|
services: {
|
|
81
82
|
identify: identify(),
|
|
82
83
|
pubsub: gossipsub({ allowPublishToZeroTopicPeers: true }),
|
|
84
|
+
obtClefPrivée: (components: ComposantesServiceClefPrivée) =>
|
|
85
|
+
new ServiceClefPrivée(components),
|
|
83
86
|
},
|
|
84
87
|
};
|
|
88
|
+
|
|
89
|
+
interface ComposantesServiceClefPrivée {
|
|
90
|
+
privateKey: PrivateKey;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
class ServiceClefPrivée {
|
|
94
|
+
private privateKey: PrivateKey;
|
|
95
|
+
|
|
96
|
+
constructor(components: ComposantesServiceClefPrivée) {
|
|
97
|
+
this.privateKey = components.privateKey;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
obtenirClef(): PrivateKey {
|
|
101
|
+
return this.privateKey;
|
|
102
|
+
}
|
|
103
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = "1.6.
|
|
2
|
+
export const version = "1.6.8";
|