@constl/utils-tests 2.2.4 → 2.2.5
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/h/303/251lia.d.ts.map +1 -1
- package/dist/h/303/251lia.js +12 -17
- package/dist/h/303/251lia.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/h/303/251lia.ts +17 -19
- package/src/version.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hélia.d.ts","sourceRoot":"","sources":["../src/hélia.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"hélia.d.ts","sourceRoot":"","sources":["../src/hélia.ts"],"names":[],"mappings":"AASA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAI3B,eAAO,MAAM,eAAe,oBAGzB;IACD,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC;IACV,MAAM,EAAE,eAAe,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAC9C,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B,CA+CA,CAAC"}
|
package/dist/h/303/251lia.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
2
|
import { MemoryBlockstore } from "blockstore-core";
|
|
3
3
|
import { createHeliaLight } from "helia";
|
|
4
|
-
import * as dagCbor from
|
|
5
|
-
import * as dagJson from
|
|
6
|
-
import * as json from
|
|
7
|
-
import { sha512 } from
|
|
4
|
+
import * as dagCbor from "@ipld/dag-cbor";
|
|
5
|
+
import * as dagJson from "@ipld/dag-json";
|
|
6
|
+
import * as json from "multiformats/codecs/json";
|
|
7
|
+
import { sha512 } from "multiformats/hashes/sha2";
|
|
8
8
|
import { IDBBlockstore } from "blockstore-idb";
|
|
9
9
|
import { isBrowser, isElectronMain, isNode } from "wherearewe";
|
|
10
|
-
import {
|
|
10
|
+
import { withLibp2pLight } from "@helia/libp2p";
|
|
11
11
|
import { sousDossier } from "./utils.js";
|
|
12
12
|
import { OptionsDéfautLibp2pNavigateur, OptionsDéfautLibp2pNode, toutesConnectées, } from "./libp2p/index.js";
|
|
13
13
|
import { obtenirAdresseRelai } from "./relai/index.js";
|
|
14
14
|
import { withBitswap } from "@helia/bitswap";
|
|
15
15
|
export const créerHéliasTest = async ({ n, dossier, }) => {
|
|
16
|
-
const optionsLibp2p = isBrowser
|
|
17
|
-
? OptionsDéfautLibp2pNavigateur()
|
|
18
|
-
: OptionsDéfautLibp2pNode();
|
|
19
16
|
const hélias = [];
|
|
20
17
|
for (const i of Array(n).keys()) {
|
|
18
|
+
// Ceci ça doit aller dans la boucle parce que `withLibp2pLight` modifie l'objet d'options
|
|
19
|
+
const optionsLibp2p = isBrowser
|
|
20
|
+
? OptionsDéfautLibp2pNavigateur()
|
|
21
|
+
: OptionsDéfautLibp2pNode();
|
|
21
22
|
const dossierBlocs = dossier
|
|
22
23
|
? join(sousDossier({ dossier, i }), "hélia", "blocks")
|
|
23
24
|
: undefined;
|
|
@@ -29,16 +30,10 @@ export const créerHéliasTest = async ({ n, dossier, }) => {
|
|
|
29
30
|
stockageBlocs.open?.();
|
|
30
31
|
const optionsHélia = {
|
|
31
32
|
blockstore: stockageBlocs,
|
|
32
|
-
codecs: [
|
|
33
|
-
|
|
34
|
-
dagJson,
|
|
35
|
-
json,
|
|
36
|
-
],
|
|
37
|
-
hashers: [
|
|
38
|
-
sha512,
|
|
39
|
-
]
|
|
33
|
+
codecs: [dagCbor, dagJson, json],
|
|
34
|
+
hashers: [sha512],
|
|
40
35
|
};
|
|
41
|
-
const hélia = await withBitswap(
|
|
36
|
+
const hélia = await withBitswap(withLibp2pLight(createHeliaLight(optionsHélia), optionsLibp2p)).start();
|
|
42
37
|
hélias.push(hélia);
|
|
43
38
|
}
|
|
44
39
|
await toutesConnectées(hélias.map((h) => h.libp2p), {
|
package/dist/h/303/251lia.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hélia.js","sourceRoot":"","sources":["../src/hélia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"hélia.js","sourceRoot":"","sources":["../src/hélia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAwB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MA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E,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAC3B;QACE,YAAY,EAAE,mBAAmB,EAAE;KACpC,CACF,CAAC;IAEF,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;QACxB,MAAM,OAAO,CAAC,GAAG,CACf,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;YACrB,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;YACf,2CAA2C;YAC3C,MAAM,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;QAC5D,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.2.
|
|
1
|
+
export declare const version = "2.2.5";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/src/h/303/251lia.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
2
|
import { MemoryBlockstore } from "blockstore-core";
|
|
3
3
|
import { createHeliaLight } from "helia";
|
|
4
|
-
import * as dagCbor from
|
|
5
|
-
import * as dagJson from
|
|
6
|
-
import * as json from
|
|
7
|
-
import { sha512 } from
|
|
4
|
+
import * as dagCbor from "@ipld/dag-cbor";
|
|
5
|
+
import * as dagJson from "@ipld/dag-json";
|
|
6
|
+
import * as json from "multiformats/codecs/json";
|
|
7
|
+
import { sha512 } from "multiformats/hashes/sha2";
|
|
8
8
|
import { IDBBlockstore } from "blockstore-idb";
|
|
9
9
|
import { isBrowser, isElectronMain, isNode } from "wherearewe";
|
|
10
|
-
import {
|
|
10
|
+
import { withLibp2pLight, type HeliaWithLibp2p } from "@helia/libp2p";
|
|
11
11
|
import { sousDossier } from "./utils.js";
|
|
12
12
|
import {
|
|
13
13
|
OptionsDéfautLibp2pNavigateur,
|
|
@@ -28,13 +28,15 @@ export const créerHéliasTest = async ({
|
|
|
28
28
|
hélias: HeliaWithLibp2p<ServicesLibp2pTest>[];
|
|
29
29
|
fermer: () => Promise<void>;
|
|
30
30
|
}> => {
|
|
31
|
-
const optionsLibp2p = isBrowser
|
|
32
|
-
? OptionsDéfautLibp2pNavigateur()
|
|
33
|
-
: OptionsDéfautLibp2pNode();
|
|
34
|
-
|
|
35
31
|
const hélias: HeliaWithLibp2p<ServicesLibp2pTest>[] = [];
|
|
32
|
+
|
|
36
33
|
for (const i of Array(n).keys()) {
|
|
37
|
-
|
|
34
|
+
// Ceci ça doit aller dans la boucle parce que `withLibp2pLight` modifie l'objet d'options
|
|
35
|
+
const optionsLibp2p = isBrowser
|
|
36
|
+
? OptionsDéfautLibp2pNavigateur()
|
|
37
|
+
: OptionsDéfautLibp2pNode();
|
|
38
|
+
|
|
39
|
+
const dossierBlocs = dossier
|
|
38
40
|
? join(sousDossier({ dossier, i }), "hélia", "blocks")
|
|
39
41
|
: undefined;
|
|
40
42
|
const stockageBlocs = dossierBlocs
|
|
@@ -45,16 +47,12 @@ export const créerHéliasTest = async ({
|
|
|
45
47
|
(stockageBlocs as IDBBlockstore).open?.();
|
|
46
48
|
const optionsHélia = {
|
|
47
49
|
blockstore: stockageBlocs,
|
|
48
|
-
codecs: [
|
|
49
|
-
|
|
50
|
-
dagJson,
|
|
51
|
-
json,
|
|
52
|
-
],
|
|
53
|
-
hashers: [
|
|
54
|
-
sha512,
|
|
55
|
-
]
|
|
50
|
+
codecs: [dagCbor, dagJson, json],
|
|
51
|
+
hashers: [sha512],
|
|
56
52
|
};
|
|
57
|
-
const hélia = await withBitswap(
|
|
53
|
+
const hélia = await withBitswap(
|
|
54
|
+
withLibp2pLight(createHeliaLight(optionsHélia), optionsLibp2p),
|
|
55
|
+
).start();
|
|
58
56
|
hélias.push(hélia);
|
|
59
57
|
}
|
|
60
58
|
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '2.2.
|
|
2
|
+
export const version = '2.2.5';
|